* git pull behavior changed? @ 2010-04-21 21:13 Aghiles 2010-04-21 21:22 ` Sverre Rabbelier 0 siblings, 1 reply; 22+ messages in thread From: Aghiles @ 2010-04-21 21:13 UTC (permalink / raw) To: git list Hello, I used to 'git pull' in a branch and it was working without any questions asked. But now, if I do the following: git checkout -b test git pull I get a warning telling me that "You asked me to pull without telling me which branch ...". I would expect that my new local branch behaves the same way as the master branch. I am using 1.7.0.3 -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:13 git pull behavior changed? Aghiles @ 2010-04-21 21:22 ` Sverre Rabbelier 2010-04-21 21:34 ` Aghiles 2010-04-21 21:55 ` Aghiles 0 siblings, 2 replies; 22+ messages in thread From: Sverre Rabbelier @ 2010-04-21 21:22 UTC (permalink / raw) To: Aghiles; +Cc: git list Heya, On Wed, Apr 21, 2010 at 23:13, Aghiles <aghilesk@gmail.com> wrote: > git checkout -b test When you do this you're telling git "I want a new branch from where I am right now". If you want to be able to pull in a similar way to how master works, use the '--track' option. -- Cheers, Sverre Rabbelier ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:22 ` Sverre Rabbelier @ 2010-04-21 21:34 ` Aghiles 2010-04-21 21:55 ` Aghiles 1 sibling, 0 replies; 22+ messages in thread From: Aghiles @ 2010-04-21 21:34 UTC (permalink / raw) To: Sverre Rabbelier; +Cc: git list > > When you do this you're telling git "I want a new branch from where I > am right now". If you want to be able to pull in a similar way to how > master works, use the '--track' option. > This means that when pulling I will be pulling from the remote ? That is what I want to achieve. I just want all my branches to pull from the same remote (as my master branch does). Thank you for your help. -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:22 ` Sverre Rabbelier 2010-04-21 21:34 ` Aghiles @ 2010-04-21 21:55 ` Aghiles 2010-04-21 21:59 ` Sverre Rabbelier 2010-04-21 21:59 ` Matthieu Moy 1 sibling, 2 replies; 22+ messages in thread From: Aghiles @ 2010-04-21 21:55 UTC (permalink / raw) To: Sverre Rabbelier; +Cc: git list > When you do this you're telling git "I want a new branch from where I > am right now". If you want to be able to pull in a similar way to how > master works, use the '--track' option. Actually, the '--track' option is exactly what I don't want ! :) It tells me: "Branch test set up to track local branch refs/heads/master." Without the '--track' option it seems to work as expected: when I pull it downloads data form the remote but then stops before merging. This used to work! What happened ? :( -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:55 ` Aghiles @ 2010-04-21 21:59 ` Sverre Rabbelier 2010-04-21 21:59 ` Matthieu Moy 1 sibling, 0 replies; 22+ messages in thread From: Sverre Rabbelier @ 2010-04-21 21:59 UTC (permalink / raw) To: Aghiles; +Cc: git list Heya, On Wed, Apr 21, 2010 at 23:55, Aghiles <aghilesk@gmail.com> wrote: > Without the '--track' option it seems to work as expected: when I pull > it downloads data form the remote but then stops before merging. > This used to work! What happened ? :( See the --track documentation, you need to tell it to track upstream instead of master. -- Cheers, Sverre Rabbelier ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:55 ` Aghiles 2010-04-21 21:59 ` Sverre Rabbelier @ 2010-04-21 21:59 ` Matthieu Moy 2010-04-21 22:04 ` Aghiles 1 sibling, 1 reply; 22+ messages in thread From: Matthieu Moy @ 2010-04-21 21:59 UTC (permalink / raw) To: Aghiles; +Cc: Sverre Rabbelier, git list Aghiles <aghilesk@gmail.com> writes: >> When you do this you're telling git "I want a new branch from where I >> am right now". If you want to be able to pull in a similar way to how >> master works, use the '--track' option. > > Actually, the '--track' option is exactly what I don't want ! :) It > tells me: Read the doc. It is what you want, but you mis-use it. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 21:59 ` Matthieu Moy @ 2010-04-21 22:04 ` Aghiles 2010-04-21 22:23 ` Matthieu Moy 2010-04-21 23:27 ` Randal L. Schwartz 0 siblings, 2 replies; 22+ messages in thread From: Aghiles @ 2010-04-21 22:04 UTC (permalink / raw) To: Matthieu Moy; +Cc: Sverre Rabbelier, git list > >>> When you do this you're telling git "I want a new branch from where I >>> am right now". If you want to be able to pull in a similar way to how >>> master works, use the '--track' option. >> >> Actually, the '--track' option is exactly what I don't want ! :) It >> tells me: > > Read the doc. It is what you want, but you mis-use it. I will read the doc, thank you for the advice. 'When creating a new branch, set up configuration to mark the start-point branch as "upstream" from the new branch.' So no, that's not what I want. Using : git branch test git checkout test git pull origin HEAD Is what I want and it works. BUT, I used to need only 'git pull' Again, the behavior changed since I last used this. No one cares? -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 22:04 ` Aghiles @ 2010-04-21 22:23 ` Matthieu Moy 2010-04-21 22:41 ` Aghiles 2010-04-21 23:27 ` Randal L. Schwartz 1 sibling, 1 reply; 22+ messages in thread From: Matthieu Moy @ 2010-04-21 22:23 UTC (permalink / raw) To: Aghiles; +Cc: Sverre Rabbelier, git list Aghiles <aghilesk@gmail.com> writes: > Again, the behavior changed since I last used this. No one cares? The behavior of Git did not change. The content of your configuration file or the branch you are on did. The way to put the right content in your configuration file is --track. When you create a branch, you say what the starting point of your branch is, and if you say --track, Git remembers it and uses it for pull next time. The simplest is to start your branch based on remotes/<name>/<branchname>, which is where your probably want to pull from. Otherwise, --set-upstream may help. But neither will help untill you RTFM. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 22:23 ` Matthieu Moy @ 2010-04-21 22:41 ` Aghiles 2010-04-22 0:01 ` Jeff King 0 siblings, 1 reply; 22+ messages in thread From: Aghiles @ 2010-04-21 22:41 UTC (permalink / raw) To: Matthieu Moy; +Cc: Sverre Rabbelier, git list > Otherwise, --set-upstream may help. But neither will help untill you > RTFM. Matthieu, I spend my days reading the git manual and also the source code, which is not normal IMHO. I always look for examples but in the case of 'git branch' there is not many that are really useful! I suggest to add this as an example since it is probably the most common case (one would expect that a new branch simply mimics the characteristics of the starting branch, no ?) git branch --track small_fixes origin And it does what I want. Again, the behavior changed: just upgraded to 1.7.0.3, before then I was doing branches like this: git checkout -b small_fixes git pull >From my point of view, that was neat! The --track and <start-point>=origin seemed to be implied. I find that this is a better better default (OR 'git pull' was defaulting to 'git pull origin HEAD'). As of now, 'git branch x' seem to be of little use without more configuration. -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 22:41 ` Aghiles @ 2010-04-22 0:01 ` Jeff King 2010-04-22 0:13 ` Aghiles 0 siblings, 1 reply; 22+ messages in thread From: Jeff King @ 2010-04-22 0:01 UTC (permalink / raw) To: Aghiles; +Cc: Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010 at 06:41:16PM -0400, Aghiles wrote: > Again, the behavior changed: just upgraded to 1.7.0.3, before then I was > doing branches like this: > > git checkout -b small_fixes > git pull What was the old version of git? A long time ago (maybe 1.5.x or earlier?) we used to default unconfigured pulls differently. -Peff ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 0:01 ` Jeff King @ 2010-04-22 0:13 ` Aghiles 2010-04-22 0:41 ` Jeff King 0 siblings, 1 reply; 22+ messages in thread From: Aghiles @ 2010-04-22 0:13 UTC (permalink / raw) To: Jeff King; +Cc: Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010, Jeff King wrote: > What was the old version of git? A long time ago (maybe 1.5.x or > earlier?) we used to default unconfigured pulls differently. I don't have the information handy but it was most probably pre-1.5. I don't know if my 'branching habits' are common, but I found that the old behavior to be more natural with the way we work (creating branches for quick parallel work). If the current behavior is here to stay, I would humbly suggest to mention the 'git checkout -b x origin' syntax in the manual (and 'git branch --track x origin'). On a positive note, I would like to say that there is a good progress regarding the messages git prints to guide the user. That is helpful. -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 0:13 ` Aghiles @ 2010-04-22 0:41 ` Jeff King 2010-04-22 1:27 ` Aghiles 0 siblings, 1 reply; 22+ messages in thread From: Jeff King @ 2010-04-22 0:41 UTC (permalink / raw) To: Aghiles; +Cc: Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010 at 08:13:48PM -0400, Aghiles wrote: > I don't have the information handy but it was most probably pre-1.5. > I don't know if my 'branching habits' are common, but I found that > the old behavior to be more natural with the way we work (creating > branches for quick parallel work). OK, then the behavior did change for you. But you are probably about 3 years too late to complain and try to get it changed. :) > If the current behavior is here to stay, I would humbly suggest to > mention the 'git checkout -b x origin' syntax in the manual (and > 'git branch --track x origin'). It is in the checkout manual, but I think the subtlety that you missed is that "--track" is going to care about whether you start your branch from your local "master" or the remote "master". Even if they're at the same commit, you are interested conceptually in basing your work on what the remote is doing. Maybe we could talk about this in the definition of <start-point>, I guess. You may also be interested to know that "git checkout foo" these days when you have no "foo" branch will do the equivalent of "git checkout -b --track foo origin/foo", which would also do what you want. -Peff ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 0:41 ` Jeff King @ 2010-04-22 1:27 ` Aghiles 2010-04-22 2:10 ` Jeff King 0 siblings, 1 reply; 22+ messages in thread From: Aghiles @ 2010-04-22 1:27 UTC (permalink / raw) To: Jeff King; +Cc: Matthieu Moy, Sverre Rabbelier, git list > OK, then the behavior did change for you. But you are probably about 3 > years too late to complain and try to get it changed. :) Dammit. :) But really no biggie. I just entered panic mode because I thought something got borked in my favorite tool, which is not the case obviously. > You may also be interested to know that "git checkout foo" these days > when you have no "foo" branch will do the equivalent of "git checkout -b > --track foo origin/foo", which would also do what you want. Wouldn't that create/track a remote 'foo' branch ? I have no remote branches but only local ones so I am always tracking origin/master. -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 1:27 ` Aghiles @ 2010-04-22 2:10 ` Jeff King 0 siblings, 0 replies; 22+ messages in thread From: Jeff King @ 2010-04-22 2:10 UTC (permalink / raw) To: Aghiles; +Cc: Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010 at 09:27:31PM -0400, Aghiles wrote: > > You may also be interested to know that "git checkout foo" these days > > when you have no "foo" branch will do the equivalent of "git checkout -b > > --track foo origin/foo", which would also do what you want. > > Wouldn't that create/track a remote 'foo' branch ? I have no remote branches > but only local ones so I am always tracking origin/master. Yes, it would, so I guess it doesn't help you. You should do "git checkout -b foo origin/master", then. -Peff ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 22:04 ` Aghiles 2010-04-21 22:23 ` Matthieu Moy @ 2010-04-21 23:27 ` Randal L. Schwartz 2010-04-21 23:57 ` Aghiles 1 sibling, 1 reply; 22+ messages in thread From: Randal L. Schwartz @ 2010-04-21 23:27 UTC (permalink / raw) To: Aghiles; +Cc: Matthieu Moy, Sverre Rabbelier, git list >>>>> "Aghiles" == Aghiles <aghilesk@gmail.com> writes: Aghiles> Using : Aghiles> git branch test Aghiles> git checkout test Aghiles> git pull origin HEAD I do this: git checkout -b test origin/test ... git pull And it seems to work. It even announces that my test is tracking origin/test. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 23:27 ` Randal L. Schwartz @ 2010-04-21 23:57 ` Aghiles 2010-04-22 8:10 ` Petr Baudis 0 siblings, 1 reply; 22+ messages in thread From: Aghiles @ 2010-04-21 23:57 UTC (permalink / raw) To: Randal L. Schwartz; +Cc: Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010, Randal L. Schwartz wrote: > git checkout -b test origin/test > ... > git pull > > And it seems to work. It even announces that my test is tracking origin/test. Yes that syntax works too (although I use origin/master since I am tracking the main branch and not the remote "test" branch). Thank you very much. The message announcing the tracked branch is a nice touch. -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-21 23:57 ` Aghiles @ 2010-04-22 8:10 ` Petr Baudis 2010-04-22 8:16 ` Junio C Hamano 0 siblings, 1 reply; 22+ messages in thread From: Petr Baudis @ 2010-04-22 8:10 UTC (permalink / raw) To: Aghiles; +Cc: Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list On Wed, Apr 21, 2010 at 07:57:17PM -0400, Aghiles wrote: > On Wed, Apr 21, 2010, Randal L. Schwartz wrote: > > git checkout -b test origin/test > > ... > > git pull > > > > And it seems to work. It even announces that my test is tracking origin/test. > > Yes that syntax works too (although I use origin/master since I am tracking > the main branch and not the remote "test" branch). Thank you very much. So, do I understand it right that there is still no canonical syntax to check out local branch tracking a remote one of the same name, without spelling out the branch name twice? -- Petr "Pasky" Baudis http://pasky.or.cz/ | "Ars longa, vita brevis." -- Hippocrates ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 8:10 ` Petr Baudis @ 2010-04-22 8:16 ` Junio C Hamano 2010-04-22 11:49 ` Creating tracked branches Petr Baudis 2010-04-22 21:13 ` git pull behavior changed? Aghiles 0 siblings, 2 replies; 22+ messages in thread From: Junio C Hamano @ 2010-04-22 8:16 UTC (permalink / raw) To: Petr Baudis Cc: Aghiles, Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list Petr Baudis <pasky@suse.cz> writes: > On Wed, Apr 21, 2010 at 07:57:17PM -0400, Aghiles wrote: >> On Wed, Apr 21, 2010, Randal L. Schwartz wrote: >> > git checkout -b test origin/test > ... > So, do I understand it right that there is still no canonical syntax to > check out local branch tracking a remote one of the same name, without > spelling out the branch name twice? Only if you don't count Dscho's DWIM. $ git checkout tr/word-diff Branch tr/word-diff set up to track remote branch tr/word-diff from origin. Switched to a new branch 'tr/word-diff' ^ permalink raw reply [flat|nested] 22+ messages in thread
* Creating tracked branches 2010-04-22 8:16 ` Junio C Hamano @ 2010-04-22 11:49 ` Petr Baudis 2010-04-22 13:47 ` Andreas Schwab 2010-04-22 21:13 ` git pull behavior changed? Aghiles 1 sibling, 1 reply; 22+ messages in thread From: Petr Baudis @ 2010-04-22 11:49 UTC (permalink / raw) To: Junio C Hamano Cc: Aghiles, Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list On Thu, Apr 22, 2010 at 01:16:10AM -0700, Junio C Hamano wrote: > Petr Baudis <pasky@suse.cz> writes: > > > On Wed, Apr 21, 2010 at 07:57:17PM -0400, Aghiles wrote: > >> On Wed, Apr 21, 2010, Randal L. Schwartz wrote: > >> > git checkout -b test origin/test > > ... > > So, do I understand it right that there is still no canonical syntax to > > check out local branch tracking a remote one of the same name, without > > spelling out the branch name twice? > > Only if you don't count Dscho's DWIM. > > $ git checkout tr/word-diff > Branch tr/word-diff set up to track remote branch tr/word-diff from origin. > Switched to a new branch 'tr/word-diff' Ugh. Right, so _this_ is what kept me from ever learning the proper way: (i) If you do `checkout B`, it will track remote branch B if it exists. (ii) If you do `checkout -b B`, it will never auto-track anything. (iii) If you do `git checkout -t -b B`, it will auto-track your current _local_ branch. This keeps getting me really confused, I hope I will remember it now for good, but I have seen others having trouble with this as well. I don't have immediate ideas that would do less harm than good to fix this up... perhaps except changing (iii) to auto-track the remote branch B if it exists and require tracked branch name if it doesn't - the current default seems pretty much useless to me for usual cases. (I can imagine a scenario where it would be useful, but not a common scenario where this would be useful default.) P.S.: The "--track without -b implies branch creation" sentence in git-checkout(1) seems to be plain wrong? -- Petr "Pasky" Baudis http://pasky.or.cz/ | "Ars longa, vita brevis." -- Hippocrates ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Creating tracked branches 2010-04-22 11:49 ` Creating tracked branches Petr Baudis @ 2010-04-22 13:47 ` Andreas Schwab 2010-04-22 14:17 ` Petr Baudis 0 siblings, 1 reply; 22+ messages in thread From: Andreas Schwab @ 2010-04-22 13:47 UTC (permalink / raw) To: Petr Baudis Cc: Junio C Hamano, Aghiles, Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list Petr Baudis <pasky@suse.cz> writes: > P.S.: The "--track without -b implies branch creation" sentence in > git-checkout(1) seems to be plain wrong? $ git branch -r origin/HEAD -> origin/master origin/html origin/maint origin/man origin/master origin/next origin/pu origin/todo $ git checkout -t origin/maint Branch maint set up to track remote branch maint from origin. Switched to a new branch 'maint' Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: Creating tracked branches 2010-04-22 13:47 ` Andreas Schwab @ 2010-04-22 14:17 ` Petr Baudis 0 siblings, 0 replies; 22+ messages in thread From: Petr Baudis @ 2010-04-22 14:17 UTC (permalink / raw) To: Andreas Schwab Cc: Junio C Hamano, Aghiles, Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list On Thu, Apr 22, 2010 at 03:47:11PM +0200, Andreas Schwab wrote: > Petr Baudis <pasky@suse.cz> writes: > > > P.S.: The "--track without -b implies branch creation" sentence in > > git-checkout(1) seems to be plain wrong? > > $ git checkout -t origin/maint > Branch maint set up to track remote branch maint from origin. > Switched to a new branch 'maint' Ah! I have not read all the gory details carefully enough. Wonderful, so this would be: > (i) If you do `checkout B`, it will track remote branch B if it > exists. > > (ii) If you do `checkout -b B`, it will never auto-track anything. > > (iii) If you do `git checkout -t -b B`, it will auto-track your > current _local_ branch. (iv) If you do `git checkout -t R`, it will track branch R, deriving local branch name B from it. -- Petr "Pasky" Baudis http://pasky.or.cz/ | "Ars longa, vita brevis." -- Hippocrates ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: git pull behavior changed? 2010-04-22 8:16 ` Junio C Hamano 2010-04-22 11:49 ` Creating tracked branches Petr Baudis @ 2010-04-22 21:13 ` Aghiles 1 sibling, 0 replies; 22+ messages in thread From: Aghiles @ 2010-04-22 21:13 UTC (permalink / raw) To: Junio C Hamano Cc: Petr Baudis, Randal L. Schwartz, Matthieu Moy, Sverre Rabbelier, git list > > Only if you don't count Dscho's DWIM. > > $ git checkout tr/word-diff > Branch tr/word-diff set up to track remote branch tr/word-diff from origin. > Switched to a new branch 'tr/word-diff' > Dscho's DWIM ? I hope I don't have to learn that to use git efficiently! :) -- aghiles ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2010-04-22 21:14 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-21 21:13 git pull behavior changed? Aghiles 2010-04-21 21:22 ` Sverre Rabbelier 2010-04-21 21:34 ` Aghiles 2010-04-21 21:55 ` Aghiles 2010-04-21 21:59 ` Sverre Rabbelier 2010-04-21 21:59 ` Matthieu Moy 2010-04-21 22:04 ` Aghiles 2010-04-21 22:23 ` Matthieu Moy 2010-04-21 22:41 ` Aghiles 2010-04-22 0:01 ` Jeff King 2010-04-22 0:13 ` Aghiles 2010-04-22 0:41 ` Jeff King 2010-04-22 1:27 ` Aghiles 2010-04-22 2:10 ` Jeff King 2010-04-21 23:27 ` Randal L. Schwartz 2010-04-21 23:57 ` Aghiles 2010-04-22 8:10 ` Petr Baudis 2010-04-22 8:16 ` Junio C Hamano 2010-04-22 11:49 ` Creating tracked branches Petr Baudis 2010-04-22 13:47 ` Andreas Schwab 2010-04-22 14:17 ` Petr Baudis 2010-04-22 21:13 ` git pull behavior changed? Aghiles
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).