{"thread":{"id":"18017","subject":"remote tracking branches","startedAt":"2009-02-25T17:41:01Z","lastAt":"2009-02-25T17:53:14Z","messageCount":2,"participants":["John Dlugosz","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106233","messageId":"450196A1AAAE4B42A00A8B27A59278E709E0485C@EXCHANGE.trad.tradestation.com","threadId":"18017","inReplyTo":null,"subject":"remote tracking branches","fromName":"John Dlugosz","fromEmail":"jdlugosz@tradestation.com","sentAt":"2009-02-25T17:41:01Z","receivedAt":"2009-02-25T17:41:01Z","isPatch":false,"sender":{"key":"jdlugosz@tradestation.com","avatar":null},"body":"The repository on my machine was apparently originally a simple file\ncopy from another development machine, or set up manually.  That is, was\nnot done by using the \"git clone\" command.  I have a [remote \"pub\"] in\nthe config file with only a url in it, so I can use \"pub\" when I push\nand pull.\n\nThe command \"git branch -r\" shows nothing.\n\nSo, there are no remote tracking branches.  So what?  At first, I think\nthat this is nothing more than the defaults to use when pulling, to get\neverything.  But, the example at the very end of Chapter 1 of the user\nmanual shows:\n\tfetch = +refs/heads/*:refs/remotes/linux-nfs/*\n\nI don't have a refs/remotes directory now.  So what does\n\tgit pull pub xx\ndo?  The _result_ is just fine, as expected.  But if pull calls fetch,\nit needs to fetch it to some temporary place first and then merge that,\nright?\n\nIf I add a suitable line to my config file (changing linux-nfs in the\nexample to pub to match the remote name), what does that buy me?  But\nfirst, is that all I need to do to enable this feature?\n\nI'm guessing that it means I will be able to examine, e.g. using gitk,\nwhat is in pub, to see if there are changes I need and keep apprised of\nother's work.\n\n--John\n"},{"id":"106234","messageId":"76718490902250953u2c6a7783x89c1ea49d045a49a@mail.gmail.com","threadId":"18017","inReplyTo":"450196A1AAAE4B42A00A8B27A59278E709E0485C@EXCHANGE.trad.tradestation.com","subject":"Re: remote tracking branches","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-02-25T17:53:14Z","receivedAt":"2009-02-25T17:53:14Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Feb 25, 2009 at 12:41 PM, John Dlugosz\n<JDlugosz@tradestation.com> wrote:\n> The repository on my machine was apparently originally a simple file\n> copy from another development machine, or set up manually.  That is, was\n> not done by using the \"git clone\" command.  I have a [remote \"pub\"] in\n> the config file with only a url in it, so I can use \"pub\" when I push\n> and pull.\n>\n> The command \"git branch -r\" shows nothing.\n>\n> So, there are no remote tracking branches.  So what?  At first, I think\n> that this is nothing more than the defaults to use when pulling, to get\n> everything.  But, the example at the very end of Chapter 1 of the user\n> manual shows:\n>        fetch = +refs/heads/*:refs/remotes/linux-nfs/*\n>\n> I don't have a refs/remotes directory now.  So what does\n>        git pull pub xx\n> do?  The _result_ is just fine, as expected.  But if pull calls fetch,\n> it needs to fetch it to some temporary place first and then merge that,\n> right?\n\nFETCH_HEAD is the temporary place.\n\n> If I add a suitable line to my config file (changing linux-nfs in the\n> example to pub to match the remote name), what does that buy me?  But\n> first, is that all I need to do to enable this feature?\n\nYes.\n\n$ git config remote.pub.fetch \"+refs/heads/*:refs/remotes/pub/*\"\n\nwill command fetch to store what it retrieves under refs/remotes/pub\nas well as in FETCH_HEAD.\n\n> I'm guessing that it means I will be able to examine, e.g. using gitk,\n> what is in pub, to see if there are changes I need and keep apprised of\n> other's work.\n\nWell it also lets you track every branch that is on pub. Otherwise\nyou're only retrieving whatever HEAD is on the remote. You may also\nfind it more natural to examine changes before merging them w/remote\ntracking branches. e.g.:\n\n$ git fetch\n$ git log pub/master..master\n\nOh, and \"git branch -v\" can now tell you how far ahead/behind your\nlocal branch is compared to the remote tracking branch.\n\nj.\n"}]}