{"thread":{"id":"18507","subject":"branch ahead in commits but push claims all up to date","startedAt":"2009-03-24T15:22:45Z","lastAt":"2009-03-26T12:48:16Z","messageCount":13,"participants":["Irene Ros","Junio C Hamano","John Tapsell","Daniel Barkalow","Santi Béjar","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109219","messageId":"7001b7a00903240822w70a57349xcc66a02cef62dc70@mail.gmail.com","threadId":"18507","inReplyTo":"7001b7a00903240821v2155d234x6a10c80a3e987acb@mail.gmail.com","subject":"branch ahead in commits but push claims all up to date","fromName":"Irene Ros","fromEmail":"imirene@gmail.com","sentAt":"2009-03-24T15:22:45Z","receivedAt":"2009-03-24T15:22:45Z","isPatch":false,"sender":{"key":"imirene@gmail.com","avatar":"https://gravatar.com/avatar/e9fb5f68e8909109c399883040a4ee1cc9e64149ce86d05d824669bdfd87a3ac?d=mp&s=160"},"body":"Hi all,\n\nI've been using git for some time now and haven't run into this issue\nbefore, perhaps someone else here has:\n\nI have a branch that is ahead of its origin by a few commits:\n\n$ git status\n# On branch myBranch\n# Your branch is ahead of 'origin/myBranch' by 10 commits.\n\nOddly, when I try to do a push, I get a message saying that everything\nis up to date:\n$ git push origin myBranch\nEverything up-to-date\n\nLooking at the log for origin/myBranch I can tell those commits are\nmissing, but I can't push them up, even with a --force flag. Any\nideas?\nHere's the config entry for this branch:\n\n[branch \"myBranch\"]\n    remote = origin\n    merge = refs/heads/myBranch\n\nThere's also nothing to pull from this branch, I'm the only one working on it.\nI use many other branches in this particular repo, and its just this\none that's giving me trouble.\n\nThanks so much!\n-- Irene\n"},{"id":"109221","messageId":"7vskl2293x.fsf@gitster.siamese.dyndns.org","threadId":"18507","inReplyTo":"7001b7a00903240822w70a57349xcc66a02cef62dc70@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-24T16:12:18Z","receivedAt":"2009-03-24T16:12:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Irene Ros <imirene@gmail.com> writes:\n\n> Hi all,\n>\n> I've been using git for some time now and haven't run into this issue\n> before, perhaps someone else here has:\n>\n> I have a branch that is ahead of its origin by a few commits:\n>\n> $ git status\n> # On branch myBranch\n> # Your branch is ahead of 'origin/myBranch' by 10 commits.\n>\n> Oddly, when I try to do a push, I get a message saying that everything\n> is up to date:\n> $ git push origin myBranch\n> Everything up-to-date\n>\n> Looking at the log for origin/myBranch I can tell those commits are\n> missing, but I can't push them up, even with a --force flag. Any\n> ideas?\n> Here's the config entry for this branch:\n>\n> [branch \"myBranch\"]\n>     remote = origin\n>     merge = refs/heads/myBranch\n\nHow does your\n\n\t[remote \"origin\"]\n\npart look like?\n"},{"id":"109223","messageId":"43d8ce650903240918q2ffdba44w241e0f378a11fd3d@mail.gmail.com","threadId":"18507","inReplyTo":"7001b7a00903240822w70a57349xcc66a02cef62dc70@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-24T16:18:08Z","receivedAt":"2009-03-24T16:18:08Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/24 Irene Ros <imirene@gmail.com>:\n> Hi all,\n>\n> I've been using git for some time now and haven't run into this issue\n> before, perhaps someone else here has:\n>\n> I have a branch that is ahead of its origin by a few commits:\n>\n> $ git status\n> # On branch myBranch\n> # Your branch is ahead of 'origin/myBranch' by 10 commits.\n\nTried running: git fetch   ?\n\nFor some weird reason  \"git push origin mybranch\"  doesn't actually\nupdate origin/mybranch.  It's more annoying :-)\n\nJohn\n\n> Oddly, when I try to do a push, I get a message saying that everything\n> is up to date:\n> $ git push origin myBranch\n> Everything up-to-date\n>\n> Looking at the log for origin/myBranch I can tell those commits are\n> missing, but I can't push them up, even with a --force flag. Any\n> ideas?\n> Here's the config entry for this branch:\n>\n> [branch \"myBranch\"]\n>     remote = origin\n>     merge = refs/heads/myBranch\n>\n> There's also nothing to pull from this branch, I'm the only one working on it.\n> I use many other branches in this particular repo, and its just this\n> one that's giving me trouble.\n>\n> Thanks so much!\n> -- Irene\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"109227","messageId":"alpine.LNX.1.00.0903241304090.19665@iabervon.org","threadId":"18507","inReplyTo":"43d8ce650903240918q2ffdba44w241e0f378a11fd3d@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-24T17:13:03Z","receivedAt":"2009-03-24T17:13:03Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 24 Mar 2009, John Tapsell wrote:\n\n> 2009/3/24 Irene Ros <imirene@gmail.com>:\n> > Hi all,\n> >\n> > I've been using git for some time now and haven't run into this issue\n> > before, perhaps someone else here has:\n> >\n> > I have a branch that is ahead of its origin by a few commits:\n> >\n> > $ git status\n> > # On branch myBranch\n> > # Your branch is ahead of 'origin/myBranch' by 10 commits.\n> \n> Tried running: git fetch   ?\n> \n> For some weird reason  \"git push origin mybranch\"  doesn't actually\n> update origin/mybranch.  It's more annoying :-)\n\nIt should, so long as you're using the native transport and \norigin/mybranch actually tracks mybranch on origin.\n\n\"git push\" doesn't update it, but the code that implements the native \ntransport does update it if it succeeds.\n\n(Actually, I'm not 100% sure that, if you update origin through some other \nchannel with exactly the commit that you now have in mybranch locally, and \nthen try the push, it will update the local tracking for that branch; is \nthat what you've hit?)\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"109276","messageId":"43d8ce650903241726s122cc468q4ea9188e1561832@mail.gmail.com","threadId":"18507","inReplyTo":"alpine.LNX.1.00.0903241304090.19665@iabervon.org","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-25T00:26:59Z","receivedAt":"2009-03-25T00:26:59Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:\n> On Tue, 24 Mar 2009, John Tapsell wrote:\n>\n>> 2009/3/24 Irene Ros <imirene@gmail.com>:\n>> > Hi all,\n>> >\n>> > I've been using git for some time now and haven't run into this issue\n>> > before, perhaps someone else here has:\n>> >\n>> > I have a branch that is ahead of its origin by a few commits:\n>> >\n>> > $ git status\n>> > # On branch myBranch\n>> > # Your branch is ahead of 'origin/myBranch' by 10 commits.\n>>\n>> Tried running: git fetch   ?\n>>\n>> For some weird reason  \"git push origin mybranch\"  doesn't actually\n>> update origin/mybranch.  It's more annoying :-)\n>\n> It should, so long as you're using the native transport and\n> origin/mybranch actually tracks mybranch on origin.\n>\n> \"git push\" doesn't update it, but the code that implements the native\n> transport does update it if it succeeds.\n>\n> (Actually, I'm not 100% sure that, if you update origin through some other\n> channel with exactly the commit that you now have in mybranch locally, and\n> then try the push, it will update the local tracking for that branch; is\n> that what you've hit?)\n\nI update via http - maybe that's why?  origin/mybranch is never\nupdated when I push.  It's not just a once-off quirk.\n\nJohn\n"},{"id":"109287","messageId":"alpine.LNX.1.00.0903242118270.19665@iabervon.org","threadId":"18507","inReplyTo":"43d8ce650903241726s122cc468q4ea9188e1561832@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-25T01:24:45Z","receivedAt":"2009-03-25T01:24:45Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 25 Mar 2009, John Tapsell wrote:\n\n> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:\n> > On Tue, 24 Mar 2009, John Tapsell wrote:\n> >\n> >> 2009/3/24 Irene Ros <imirene@gmail.com>:\n> >> > Hi all,\n> >> >\n> >> > I've been using git for some time now and haven't run into this issue\n> >> > before, perhaps someone else here has:\n> >> >\n> >> > I have a branch that is ahead of its origin by a few commits:\n> >> >\n> >> > $ git status\n> >> > # On branch myBranch\n> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.\n> >>\n> >> Tried running: git fetch   ?\n> >>\n> >> For some weird reason  \"git push origin mybranch\"  doesn't actually\n> >> update origin/mybranch.  It's more annoying :-)\n> >\n> > It should, so long as you're using the native transport and\n> > origin/mybranch actually tracks mybranch on origin.\n> >\n> > \"git push\" doesn't update it, but the code that implements the native\n> > transport does update it if it succeeds.\n> >\n> > (Actually, I'm not 100% sure that, if you update origin through some other\n> > channel with exactly the commit that you now have in mybranch locally, and\n> > then try the push, it will update the local tracking for that branch; is\n> > that what you've hit?)\n> \n> I update via http - maybe that's why?  origin/mybranch is never\n> updated when I push.  It's not just a once-off quirk.\n\nYup, http doesn't have it. One of my series currently in next moves it \nfrom the git-specific protocol to the common code, but there's still work \nto be done to allow the http push transport to report back to the common \ncode what got updated successfully, which is largely a matter of making \nthe http-push code run in-process instead of as a command run by \ntransport.c, and using the just-added API.\n\n\t-Daniel\n*This .sig left intentionally blank*"},{"id":"109289","messageId":"7001b7a00903241901w107e2973i9912eab114c9cde0@mail.gmail.com","threadId":"18507","inReplyTo":"alpine.LNX.1.00.0903242118270.19665@iabervon.org","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Irene Ros","fromEmail":"imirene@gmail.com","sentAt":"2009-03-25T02:01:10Z","receivedAt":"2009-03-25T02:01:10Z","isPatch":false,"sender":{"key":"imirene@gmail.com","avatar":"https://gravatar.com/avatar/e9fb5f68e8909109c399883040a4ee1cc9e64149ce86d05d824669bdfd87a3ac?d=mp&s=160"},"body":"Hi All,\n\nThank you for the good advice. I may be the case I am somehow misusing\ngit... I couldn't resolve the issue and so I created a new project off\nof the same repo. Switching to the same branch in question yielded an\neven stranger result: In this new project, the commits were there (I\ncould see them in git log and in git log origin/myBranch) whereas in\nthe previous older project I did not... does that make sense? Our\norigin branches are located on a central server so can't quite figure\nout why viewing the log of the same remote branch from two different\nprojects would yield different results. Any suggestions? At this\npoint, I'm just really curious.\n\n-- Irene\n\n\n\nOn Tue, Mar 24, 2009 at 9:24 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> On Wed, 25 Mar 2009, John Tapsell wrote:\n>\n>> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:\n>> > On Tue, 24 Mar 2009, John Tapsell wrote:\n>> >\n>> >> 2009/3/24 Irene Ros <imirene@gmail.com>:\n>> >> > Hi all,\n>> >> >\n>> >> > I've been using git for some time now and haven't run into this issue\n>> >> > before, perhaps someone else here has:\n>> >> >\n>> >> > I have a branch that is ahead of its origin by a few commits:\n>> >> >\n>> >> > $ git status\n>> >> > # On branch myBranch\n>> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.\n>> >>\n>> >> Tried running: git fetch   ?\n>> >>\n>> >> For some weird reason  \"git push origin mybranch\"  doesn't actually\n>> >> update origin/mybranch.  It's more annoying :-)\n>> >\n>> > It should, so long as you're using the native transport and\n>> > origin/mybranch actually tracks mybranch on origin.\n>> >\n>> > \"git push\" doesn't update it, but the code that implements the native\n>> > transport does update it if it succeeds.\n>> >\n>> > (Actually, I'm not 100% sure that, if you update origin through some other\n>> > channel with exactly the commit that you now have in mybranch locally, and\n>> > then try the push, it will update the local tracking for that branch; is\n>> > that what you've hit?)\n>>\n>> I update via http - maybe that's why?  origin/mybranch is never\n>> updated when I push.  It's not just a once-off quirk.\n>\n> Yup, http doesn't have it. One of my series currently in next moves it\n> from the git-specific protocol to the common code, but there's still work\n> to be done to allow the http push transport to report back to the common\n> code what got updated successfully, which is largely a matter of making\n> the http-push code run in-process instead of as a command run by\n> transport.c, and using the just-added API.\n>\n>        -Daniel\n> *This .sig left intentionally blank*\n"},{"id":"109292","messageId":"43d8ce650903241913p13d8ac7g9473bb0354c2f2ea@mail.gmail.com","threadId":"18507","inReplyTo":"7001b7a00903241901w107e2973i9912eab114c9cde0@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-25T02:13:33Z","receivedAt":"2009-03-25T02:13:33Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/25 Irene Ros <imirene@gmail.com>:\n> Hi All,\n>\n> Thank you for the good advice. I may be the case I am somehow misusing\n\nSo, did you actually try:\n\ngit fetch\n\n?\n\n> git... I couldn't resolve the issue and so I created a new project off\n> of the same repo. Switching to the same branch in question yielded an\n> even stranger result: In this new project, the commits were there (I\n> could see them in git log and in git log origin/myBranch) whereas in\n> the previous older project I did not... does that make sense? Our\n> origin branches are located on a central server so can't quite figure\n> out why viewing the log of the same remote branch from two different\n> projects would yield different results. Any suggestions? At this\n> point, I'm just really curious.\n>\n> -- Irene\n>\n>\n>\n> On Tue, Mar 24, 2009 at 9:24 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n>> On Wed, 25 Mar 2009, John Tapsell wrote:\n>>\n>>> 2009/3/24 Daniel Barkalow <barkalow@iabervon.org>:\n>>> > On Tue, 24 Mar 2009, John Tapsell wrote:\n>>> >\n>>> >> 2009/3/24 Irene Ros <imirene@gmail.com>:\n>>> >> > Hi all,\n>>> >> >\n>>> >> > I've been using git for some time now and haven't run into this issue\n>>> >> > before, perhaps someone else here has:\n>>> >> >\n>>> >> > I have a branch that is ahead of its origin by a few commits:\n>>> >> >\n>>> >> > $ git status\n>>> >> > # On branch myBranch\n>>> >> > # Your branch is ahead of 'origin/myBranch' by 10 commits.\n>>> >>\n>>> >> Tried running: git fetch   ?\n>>> >>\n>>> >> For some weird reason  \"git push origin mybranch\"  doesn't actually\n>>> >> update origin/mybranch.  It's more annoying :-)\n>>> >\n>>> > It should, so long as you're using the native transport and\n>>> > origin/mybranch actually tracks mybranch on origin.\n>>> >\n>>> > \"git push\" doesn't update it, but the code that implements the native\n>>> > transport does update it if it succeeds.\n>>> >\n>>> > (Actually, I'm not 100% sure that, if you update origin through some other\n>>> > channel with exactly the commit that you now have in mybranch locally, and\n>>> > then try the push, it will update the local tracking for that branch; is\n>>> > that what you've hit?)\n>>>\n>>> I update via http - maybe that's why?  origin/mybranch is never\n>>> updated when I push.  It's not just a once-off quirk.\n>>\n>> Yup, http doesn't have it. One of my series currently in next moves it\n>> from the git-specific protocol to the common code, but there's still work\n>> to be done to allow the http push transport to report back to the common\n>> code what got updated successfully, which is largely a matter of making\n>> the http-push code run in-process instead of as a command run by\n>> transport.c, and using the just-added API.\n>>\n>>        -Daniel\n>> *This .sig left intentionally blank*\n>\n"},{"id":"109303","messageId":"alpine.LNX.1.00.0903242304530.19665@iabervon.org","threadId":"18507","inReplyTo":"7001b7a00903241901w107e2973i9912eab114c9cde0@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-03-25T03:19:47Z","receivedAt":"2009-03-25T03:19:47Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 24 Mar 2009, Irene Ros wrote:\n\n> Hi All,\n> \n> Thank you for the good advice. I may be the case I am somehow misusing\n> git... I couldn't resolve the issue and so I created a new project off\n> of the same repo. Switching to the same branch in question yielded an\n> even stranger result: In this new project, the commits were there (I\n> could see them in git log and in git log origin/myBranch) whereas in\n> the previous older project I did not... does that make sense? Our\n> origin branches are located on a central server so can't quite figure\n> out why viewing the log of the same remote branch from two different\n> projects would yield different results. Any suggestions? At this\n> point, I'm just really curious.\n\norigin/* is a copy of what git saw the last time it talked to the remote \nrepository. This may be different from what the remote repository now \ncontains. (Also, there are a few cases in which pushing to a remote \nrepository doesn't count as talking to it; fetching with a configured \nremote always counts.) The local copies are handy for being able to \ncompare the work you've done locally with what is in the remote repository \nwhen you don't necessarily have a network connection, don't expect \nconstant updates remotely, or don't want to be distracted by remote \nchanges. For example, you might have your local work, and you might want \nto compare it with what other people have done. You want to avoid having \nadditional changes that other people make while you're making this \ncomparison show up in the middle.\n\nOf course, when you make a new clone of the same repository, this clone \nwill look at the repository when you make the clone, and will have the \nlatest information (as of that time). \n\nIn order to get an existing repository to see changes to a remote \nrepository, use \"git fetch <remote>\" (you can leave off the <remote> to \nget the oone you gave to \"clone\", which is configured as \"origin\"). \nAlternatively, you can use \"git pull\" to get the data and also merge it in \nthe same command, which may or may not be a useful addition depending on \nyour workflow.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"109376","messageId":"7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com","threadId":"18507","inReplyTo":"alpine.LNX.1.00.0903242304530.19665@iabervon.org","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Irene Ros","fromEmail":"imirene@gmail.com","sentAt":"2009-03-25T17:23:43Z","receivedAt":"2009-03-25T17:23:43Z","isPatch":false,"sender":{"key":"imirene@gmail.com","avatar":"https://gravatar.com/avatar/e9fb5f68e8909109c399883040a4ee1cc9e64149ce86d05d824669bdfd87a3ac?d=mp&s=160"},"body":"Hi Daniel,\n\nThank you for the explanation, doing a git fetch actually did do the\ntrick although I still don't quite see the difference between\ngit pull origin myBranch\nand\ngit fetch\n\nWhen I push to origin myBranch it's clear that it actually pushes my\nchanges to our remote repository since others can then pull and get\nthem. So is it the case that:\n\ngit push ==> actual remote repository\nwhile\ngit pull <== local copy of remote repository for this branch ?\n\nIn that case why is it that in all branches that I have, besides this\none, doing a 'git pull origin whateverBranch' actually pulls from the\nremote branch and not the local copy? This case has been quite unique\ngiven dozens of branches that we constantly switch to and from. We've\nnever actually used (or clearly saw the need for) git fetch until now.\n\nThank you so much for your insight, it's very helpful in understanding\nthese subtleties.\n\n-- Irene\n\n\n\nOn Tue, Mar 24, 2009 at 11:19 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> On Tue, 24 Mar 2009, Irene Ros wrote:\n>\n>> Hi All,\n>>\n>> Thank you for the good advice. I may be the case I am somehow misusing\n>> git... I couldn't resolve the issue and so I created a new project off\n>> of the same repo. Switching to the same branch in question yielded an\n>> even stranger result: In this new project, the commits were there (I\n>> could see them in git log and in git log origin/myBranch) whereas in\n>> the previous older project I did not... does that make sense? Our\n>> origin branches are located on a central server so can't quite figure\n>> out why viewing the log of the same remote branch from two different\n>> projects would yield different results. Any suggestions? At this\n>> point, I'm just really curious.\n>\n> origin/* is a copy of what git saw the last time it talked to the remote\n> repository. This may be different from what the remote repository now\n> contains. (Also, there are a few cases in which pushing to a remote\n> repository doesn't count as talking to it; fetching with a configured\n> remote always counts.) The local copies are handy for being able to\n> compare the work you've done locally with what is in the remote repository\n> when you don't necessarily have a network connection, don't expect\n> constant updates remotely, or don't want to be distracted by remote\n> changes. For example, you might have your local work, and you might want\n> to compare it with what other people have done. You want to avoid having\n> additional changes that other people make while you're making this\n> comparison show up in the middle.\n>\n> Of course, when you make a new clone of the same repository, this clone\n> will look at the repository when you make the clone, and will have the\n> latest information (as of that time).\n>\n> In order to get an existing repository to see changes to a remote\n> repository, use \"git fetch <remote>\" (you can leave off the <remote> to\n> get the oone you gave to \"clone\", which is configured as \"origin\").\n> Alternatively, you can use \"git pull\" to get the data and also merge it in\n> the same command, which may or may not be a useful addition depending on\n> your workflow.\n>\n>        -Daniel\n> *This .sig left intentionally blank*\n>\n"},{"id":"109377","messageId":"adf1fd3d0903251032kba19d27gc066b04081a88082@mail.gmail.com","threadId":"18507","inReplyTo":"7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-03-25T17:32:37Z","receivedAt":"2009-03-25T17:32:37Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2009/3/25 Irene Ros <imirene@gmail.com>:\n> Hi Daniel,\n>\n> Thank you for the explanation, doing a git fetch actually did do the\n> trick although I still don't quite see the difference between\n> git pull origin myBranch\n\nThis fetches myBranch from origin, and merges with the current branch.\n\n> and\n> git fetch\n\nThis fetches and *saves* the configured branches (all by default) from\nthe configured remote (origin by default).\n\n>\n> When I push to origin myBranch it's clear that it actually pushes my\n> changes to our remote repository since others can then pull and get\n> them. So is it the case that:\n>\n> git push ==> actual remote repository\n> while\n> git pull <== local copy of remote repository for this branch ?\n\nI don't know if I understand correctly, but pull always uses the\nbranches from the remote repository, but depending on how you call it\nit will also update the local copy (origin/*).\n\nHTH,\nSanti\n"},{"id":"109457","messageId":"43d8ce650903251905p6f9798f5u79be7dff3b118d5c@mail.gmail.com","threadId":"18507","inReplyTo":"7001b7a00903251023r1ce5cc0dnb29b7f9379408c42@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-26T02:05:21Z","receivedAt":"2009-03-26T02:05:21Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/25 Irene Ros <imirene@gmail.com>:\n> Hi Daniel,\n>\n> Thank you for the explanation, doing a git fetch actually did do the\n> trick although I still don't quite see the difference between\n> git pull origin myBranch\n> and\n> git fetch\n\ngit pull origin myBranch    is equivalent to two commands:\n\ngit fetch\ngit merge origin/myBranch\n\n(so fetch actual remote repository to local remote repository.  Then\ndo the merge)\n\n>\n> When I push to origin myBranch it's clear that it actually pushes my\n> changes to our remote repository since others can then pull and get\n> them. So is it the case that:\n>\n> git push ==> actual remote repository\nYes\n\n> while\n> git pull <== local copy of remote repository for this branch ?\n\ngit pull <== actual remote repository copied to local copy of remote\nrepository.  Then local copy of remote repository merged into your\nbranch.\n\n\n> In that case why is it that in all branches that I have, besides this\n> one, doing a 'git pull origin whateverBranch' actually pulls from the\n> remote branch and not the local copy? This case has been quite unique\n> given dozens of branches that we constantly switch to and from. We've\n> never actually used (or clearly saw the need for) git fetch until now.\n\n\nIf you always git pull  after git push, then you'll have no problem,\nsince git pull also does a git fetch.\n\ngit is sometimes a bit too bare bones :-/  It would be nice to try to\nhide these implementation details better\n"},{"id":"109526","messageId":"20090326124816.GB3114@atjola.homenet","threadId":"18507","inReplyTo":"43d8ce650903251905p6f9798f5u79be7dff3b118d5c@mail.gmail.com","subject":"Re: branch ahead in commits but push claims all up to date","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2009-03-26T12:48:16Z","receivedAt":"2009-03-26T12:48:16Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2009.03.26 02:05:21 +0000, John Tapsell wrote:\n> 2009/3/25 Irene Ros <imirene@gmail.com>:\n> > Thank you for the explanation, doing a git fetch actually did do the\n> > trick although I still don't quite see the difference between\n> > git pull origin myBranch\n> > and\n> > git fetch\n> \n> git pull origin myBranch    is equivalent to two commands:\n> \n> git fetch\n> git merge origin/myBranch\n\nNo. If that was the case, the remote tracking branches would be updated\nby the \"git fetch\" part. And there wouldn't be a difference between the\ntwo commands WRT the handling of remote tracking branches.\n\ngit pull origin myBranch does something like:\n\ngit fetch origin myBranch\ngit merge FETCH_HEAD\n\nThe remote and the refspec are passed to \"git fetch\" by \"git pull\".\nSo because there's an explicit refspec, the default value from the\nconfig is not used. And because the refspec has no right side, things\nget stored to FETCH_HEAD.\n\nBjörn\n"}]}