[git-users] Re: Problem with moving everything into a subdirectory; merge conflicts
Hi Philip, Am 2013-01-08 00:02, schrieb Philip Oakley: That is, do I understand correctly that if I had used the default merge strategy, and somehow solved all the conflicts (so that none of the files had been changed from F), the result would have technically been exactly the same? Obviously/hopefully your solution to any conflicts would have ended up being an ours choice anyway... Given that you already had a recent merge before the restructuring I would expect that it would be exactl;y the same! Ok, things seem to work very well: I'm not ready yet to test if *future* commits on the two branches, and future merges among them, will work as expected, but it looks as if everything worked out exactly as hoped. :-) Philip, thank you very much for your help! Best regards, Carsten -- Cafu - the open-source Game and Graphics Engine for multiplayer, cross-platform, real-time 3D Action Learn more at http://www.cafu.de --
[git-users] Re: git push
On Tuesday, January 8, 2013 8:47:10 AM UTC+1, k-joseph wrote: Hi every one, am kindly requesting for your assistance, i successfully push to a remote branch on my account for the first time( first push where i use git push origin name of the branch) but when am pushing the second or any other time except the first i normally get an error $ git push Enter passphrase for key '/c/Users/kaweesi joseph/.ssh/id_rsa': error: src refspec refs/heads/trunk-3...@github.com javascript: does not match any. error: failed to push some refs to 'g...@github.com:k-joseph/openmrs-core.git' i have also tried using git push --all and i get $ git push --all Enter passphrase for key '/c/Users/kaweesi joseph/.ssh/id_rsa': Counting objects: 249, done. Delta compression using up to 4 threads. Compressing objects: 100% (79/79), done. Writing objects: 100% (139/139), 24.36 KiB, done. Total 139 (delta 72), reused 99 (delta 45) To g...@github.com:k-joseph/openmrs-core.git 9b76cd3..9e4ba80 TRUNK-3814 - TRUNK-3814 * [new branch] TRUNK-2449 - TRUNK-2449 * [new branch] testing - testing ! [rejected]master - master (non-fast-forward) error: failed to push some refs to 'g...@github.com:k-joseph/openmrs-core.git' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. So i have always been deleting the remote branch in order to succeed in pushing my changes to a remote branch, i fill this is not the best way to do this Please help me with a git command that i can use to push to a remote branch the second, third or even more time without first deleting the remote branch, thanks all Git rejects the pushing of changes to master branch because your local master branch is not up-to-date or newer that what's on github. This typically happens when someone else pushes to github/master before you do, or when you are locally rewriting history that has already been pushed to github, and then you push again. I'm not sure how you've achieved it exactly. Can you tell us some more about the operations or git commands you do regularly? Does this pushing problem occur after every commit? Are other people pushing to the same repository? When the error occurs, you can either: 1) Overwrite your local master branch with what is remotely on github: git reset --hard origin/master, OR 2) Merge the remote master branch with your local one: basically do a git pull before pushing. Of course, there probably is a root problem here in your process that leads you to into getting an outdated master branch all the time. --
[git-users] git write-tree followed by git diff-files
Dear Git users, I have some difficulties to understand, why git read-tree followed by a git diff-files actually shows some changes between the index and working directory. The attached script demonstrates the observation. The output on my computer can be seen in the following (note that echo line does 'echo test testdir/testfile'). + rm -Rf test + git init test Initialized empty Git repository in /home/sba/gittest/test/.git/ + cd test + mkdir testdir + echo test + git update-index --add testdir/testfile ++ git write-tree + tree=ccab85fd26420d7707f41efd82d4182d06bf0cde + git read-tree ccab85fd26420d7707f41efd82d4182d06bf0cde + git diff-files :100644 100644 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 M testdir/testfile + git status # On branch master # # Initial commit # # Changes to be committed: # (use git rm --cached file... to unstage) # # new file: testdir/testfile # + git diff-files sba@stan:~/gittest$ So what you see in this sequence is that git read-tree puts the tree into the index. The index matches the files in the working directory, but nonetheless, git diff-files lists the single file as different (git diff-files is supposed to list differences between index and working directory). After calling 'git status' 'git diff-files' works as expected. Is there any explanation why git behaves like that? Note that this is a test case in the t-basic.sh suite so this is actually the expected behaviour. Thanks in advance! Best Sebastian -- #!/bin/sh set -x rm -Rf test git init test cd test mkdir testdir echo test testdir/testfile git update-index --add testdir/testfile tree=`git write-tree` git read-tree $tree git diff-files git status git diff-files
[git-users] Re: git write-tree followed by git diff-files
Okay, I found an explanation myself in the manual of git update-index. It seems that the --refresh option is needed. --
Re: [git-users] download a directory or file without clone the whole tree
On Mon, 7 Jan 2013 10:39:53 +0800 lei yang yanglei.f...@gmail.com wrote: I find my treeA want to have another treeB's dir, I don't want to clone the whole treeB, I don't know can we do it with git the get treeB's dir You can't fetch just a directory from a remote tree as Git does not explicitly track directories (some would even insist on that Git does not even explicitly track files, but let's not touch this now), so Git's remote protocol(s) have no idea about directories and files -- they only know about commits (and various ways to refer to them). What you can do though is use the so-called shallow cloning to get a minimum possible amount of history from the treeB and then extract the relevant directory from it. The way to go is to use the --depth=1 command line option to `git clone` which means telling it to fetch just the tip commit of the single branch. Note that the branch to fetch is defined by the contents of the remote's HEAD reference; it's usually master but if it isn't or if your treeB is not master, then tell `git clone` which branch you want to get using its --branch=treeB command-line option. That is, use something like: $ git clone --depth=1 --branch=treeB remoteURL localDir Note that `git fetch` supports shallow mode of operation as well so you can bring only the tip commit of the remote treeB into your existing repository containing treeA -- this might have certain operational advantages. --
Re: [git-users] Issue in checking out repo in GIT in eclipse
On Mon, 7 Jan 2013 19:54:49 -0800 (PST) gaug...@gmail.com wrote: [...] I have installed EGIT plugin my eclipse. I tried checking importing the files from using the plugin by choosing the URI option in eclipse and got an Unknown Host Exception. These are the setting i gave: 1) URI : user@hostname:/path/to/repo 2) Host : hostname 3) Repository Path : /path/to/repo 4) Protocol :SSH 5) Port : 22 6) user : username 7) pwd : password Is there any place that in need to enter the ip address. The server is on my lan and I can access and work on my repo using putty. What info is missing here. I have no experience with Eclipse but I might have a clue for you. The manual page of `git clone` specifies under its GIT URLS section that two valid URL syntaxes for SSH protocol are: 1) Base: ssh://[user@]host.xz[:port]/path/to/repo.git/ 2) Alternative, scp-like: [user@]host.xz:path/to/repo.git/ As you can see, if you do not specify the schema (ssh://), then the colon after the host part must be followed by a port number or, if the port number is omitted, must not be present. In the alternative case, there's no slash (/) after the colon. I do not understand the settings you cited as what's specified under points 2..7 duplicates what's specified under point 1 (the URI). In either case, I would first try to set your URI to ssh://user@hostname/path/to/repo and then would try to reconcile this with the rest of the settings. Probably you can try to leave only the URI and remove the rest of the settings, or leave the settings as is but remove the URI -- all I can tell is that they duplicate each other so I don't really see a point. --
[git-users] Management of a puppet tree and multiple developers
I'm trying to solve a problem with git, but I think I'm going about it the wrong way. I've tried searching for a lot of related terms, but either the answer isn't out there, or I'm not trying the right words. It's possible git can't do what I want, but I hope so. We've been using git to manage our puppet manifests and content files for over a year now. We have 2 branches, master and devel. We make changes to the devel branch, do a git pull of devel on the development server, then test with the development workstations. When the changes are ready, we merge them into master, do a git pull of master on the production server, and the production network (Linux) clients get the changes. This has been working well enough. There are only 2 of us making changes, so there are few conflicts. The issue is that now we're adding 2 more developers for a different platform (OS X), but they'll be working with files in the same filesystem tree (and currently the same git branch) as we are for Linux. 99% of their work will be on different files, but in the same directories as our files. What we'd like to be able to do is push either: a) changes just made to the Linux files b) changes made by one person c) select commits to the master branch, and thus production server, without also merging any potentially not-ready-for-prime-time changes made to the OS X files and/or one or both of the OS X developers. It would be nice for Linux developer A to be able to exclude Linux developer B's changes too, sometimes, but not as critical. We initially thought of creating a separate development branch that only had their files, but trying to have two git branches share a single filesystem location doesn't work, at least not the way we're doing it (check out the OS X branch, and /etc/puppet/darwinstuff is there, but /etc/puppet/linuxstuff vanishes, and vice-versa). Complicating things is the fact that their files (currently a small quantity, but sure to grow) are currently in the devel branch as the result of a previous effort. I feel like this has to be easier than I'm making it, and I'm just going about it the wrong way because I don't understand Git well enough. But the documentation I've found doesn't really seem to describe how to solve this. --
Re: [git-users] Management of a puppet tree and multiple developers
I don't have a good answer, being a newbie. But I'm wondering why you have people doing a git push on not ready for prime-time changes. The OSX people, or just each individual, can keep a local branch in their working directory. When they need to move a file or files into development, they can do a git merge on their own desktop into the devel branch on their desktop. They then push the devel branch up to the global repository. If they want, they can maintain multiple local branches on their desktop. Or, instead of doing a git merge, perhaps they could do something like: #we are normally in the local branch git checkout devel # git cat-file -p local:file-to-copy-to-devel file-to-copy-to-devel git add file-to-copy-to-devel # git cat-file -p local:file2.txt file2.txt git add file2.txt # and so on git commit git push git checkout local #back to local branch or, to merge all the files from local to devel git checkout devel git merge local git push git checkout local Again, the local branch exists only on the individual user's system, not in the global repository. If I'm totally out of wack, I'm sure one of the truly knowledgeable will kindly correct me. Does this sound reasonable? On Tue, Jan 8, 2013 at 2:12 PM, Ray Shaw rsh...@umbc.edu wrote: I'm trying to solve a problem with git, but I think I'm going about it the wrong way. I've tried searching for a lot of related terms, but either the answer isn't out there, or I'm not trying the right words. It's possible git can't do what I want, but I hope so. We've been using git to manage our puppet manifests and content files for over a year now. We have 2 branches, master and devel. We make changes to the devel branch, do a git pull of devel on the development server, then test with the development workstations. When the changes are ready, we merge them into master, do a git pull of master on the production server, and the production network (Linux) clients get the changes. This has been working well enough. There are only 2 of us making changes, so there are few conflicts. The issue is that now we're adding 2 more developers for a different platform (OS X), but they'll be working with files in the same filesystem tree (and currently the same git branch) as we are for Linux. 99% of their work will be on different files, but in the same directories as our files. What we'd like to be able to do is push either: a) changes just made to the Linux files b) changes made by one person c) select commits to the master branch, and thus production server, without also merging any potentially not-ready-for-prime-time changes made to the OS X files and/or one or both of the OS X developers. It would be nice for Linux developer A to be able to exclude Linux developer B's changes too, sometimes, but not as critical. We initially thought of creating a separate development branch that only had their files, but trying to have two git branches share a single filesystem location doesn't work, at least not the way we're doing it (check out the OS X branch, and /etc/puppet/darwinstuff is there, but /etc/puppet/linuxstuff vanishes, and vice-versa). Complicating things is the fact that their files (currently a small quantity, but sure to grow) are currently in the devel branch as the result of a previous effort. I feel like this has to be easier than I'm making it, and I'm just going about it the wrong way because I don't understand Git well enough. But the documentation I've found doesn't really seem to describe how to solve this. -- -- Maranatha! John McKown --
Re: [git-users] Management of a puppet tree and multiple developers
More people essentially means you will want more branches (complexity got just too big for the two branch model), probably one per feature, branched off devel and re-merged [either feature - devel; or devel(latest) -feature depending on flow] whenever a feature is ready for testing. Once a feature is proven it's 'properly' merged (or rebased) to devel, and then across to master. http://nvie.com/posts/a-successful-git-branching-model/ http://git-scm.com/book/en/Git-Branching-Branching-Workflows http://randyfay.com/content/rebase-workflow-git and don't forget the manual (dftm) `git help workflows` Philip - Original Message - From: Ray Shaw To: git-users@googlegroups.com Sent: Tuesday, January 08, 2013 8:12 PM Subject: [git-users] Management of a puppet tree and multiple developers I'm trying to solve a problem with git, but I think I'm going about it the wrong way. I've tried searching for a lot of related terms, but either the answer isn't out there, or I'm not trying the right words. It's possible git can't do what I want, but I hope so. We've been using git to manage our puppet manifests and content files for over a year now. We have 2 branches, master and devel. We make changes to the devel branch, do a git pull of devel on the development server, then test with the development workstations. When the changes are ready, we merge them into master, do a git pull of master on the production server, and the production network (Linux) clients get the changes. This has been working well enough. There are only 2 of us making changes, so there are few conflicts. The issue is that now we're adding 2 more developers for a different platform (OS X), but they'll be working with files in the same filesystem tree (and currently the same git branch) as we are for Linux. 99% of their work will be on different files, but in the same directories as our files. What we'd like to be able to do is push either: a) changes just made to the Linux files b) changes made by one person c) select commits to the master branch, and thus production server, without also merging any potentially not-ready-for-prime-time changes made to the OS X files and/or one or both of the OS X developers. It would be nice for Linux developer A to be able to exclude Linux developer B's changes too, sometimes, but not as critical. We initially thought of creating a separate development branch that only had their files, but trying to have two git branches share a single filesystem location doesn't work, at least not the way we're doing it (check out the OS X branch, and /etc/puppet/darwinstuff is there, but /etc/puppet/linuxstuff vanishes, and vice-versa). Complicating things is the fact that their files (currently a small quantity, but sure to grow) are currently in the devel branch as the result of a previous effort. I feel like this has to be easier than I'm making it, and I'm just going about it the wrong way because I don't understand Git well enough. But the documentation I've found doesn't really seem to describe how to solve this. -- No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.2805 / Virus Database: 2637/6016 - Release Date: 01/07/13 --
[git-users] Can Git do all of this?
Can Git do some or all of the things listed below? If so, I'd appreciate some recommendations for each piece of the puzzle... TIA! I am attempting to select a good SCM for our particular development circumstances, and Git has been selected for the short-list. We have a small development team working out of our geographically distant homes on a multi-platform application written in several languages. At the risk of starting a holy war, any recommendations you might have are most welcome. Thanks in advance! Greg - 1. A general architecture as follows: a. Distributed repository model where local branches are pemitted and all repositories are kept in sync with reasonable latency (I believe Git does this; please correct me if I'm wrong) b. Capable of synchronization with a secure repository in the cloud as redundant off-site storage (either free or subscription) 2. Provide a seamless developer SCM experience from within the following development environments: a. Microsoft Visual Studio (HTML/JavaScript/C# development for PC/Windows and Windows Phone) b. Eclipse (HTML/JavaScript/Java development for Android devices) c. Apple Xcode (HTML/JavaScript/Objective-C development for Mac/OS X, iPad, iPod, and iPhone) 3. Provide full-featured user interfaces for the following platforms (particularly where IDE integration in #1 above is not available): a. PC with Microsoft Windows 7 (GUI and command shell, preferrably PowerShell) b. Mac with OS X c. Browser-based web interface for the secure repository in the cloud (for use on machines/devices where Git is not installed) --
[git-users] can't have a directory named bundle?
Hi, I happened to create a subdirectory in my working set called bundle, and I noticed that git ignored it. Why is that? And what if I need such a directory? Thanks, Mike --
Re: [git-users] can't have a directory named bundle?
Do you a have a file named .gitignore in the project root? If you have, all files and directories listed in this file will be ignored by git. William Seiti Mizuta @williammizuta Desenvolvedor da Caelum On Wed, Jan 9, 2013 at 12:34 AM, msoulier msoul...@digitaltorque.ca wrote: Hi, I happened to create a subdirectory in my working set called bundle, and I noticed that git ignored it. Why is that? And what if I need such a directory? Thanks, Mike -- --
Re: [git-users] can't have a directory named bundle?
On 2013-01-08, at 11:18 PM, William Mizuta william.miz...@gmail.com wrote: Do you a have a file named .gitignore in the project root? If you have, all files and directories listed in this file will be ignored by git. No, I don't. Test this yourself, I doubt there's anything special about my setup. Mike --