{"thread":{"id":"30396","subject":"git pull and GIT_DIR","startedAt":"2012-05-02T14:25:36Z","lastAt":"2012-05-02T23:21:02Z","messageCount":3,"participants":["bill lam","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"190559","messageId":"20120502142536.GA2609@debian.b2j","threadId":"30396","inReplyTo":null,"subject":"git pull and GIT_DIR","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2012-05-02T14:25:36Z","receivedAt":"2012-05-02T14:25:36Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"It appeared that\n\na)\ncd /path/to && git pull git/https://....\n\nwill fetch and checkout latest changes to working tree.  This is as\nexpected.  On the contrary\n\nb)\nGIT_DIR=/path/to/.git git pull git/https://....\n\nwill only update git repo, but leaving working tree untouched.\nSubsequent git status and git diff will indicate unstaged changes, \napparently a commit that will revert the updated git repo. I have to\ndo 'git reset --hard' to really update the working three.\n\nI'm not sure if this is an intended behavior or I missed something. \n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n"},{"id":"190586","messageId":"7v62ceiejp.fsf@alter.siamese.dyndns.org","threadId":"30396","inReplyTo":"20120502142536.GA2609@debian.b2j","subject":"Re: git pull and GIT_DIR","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-02T19:11:22Z","receivedAt":"2012-05-02T19:11:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"bill lam <cbill.lam@gmail.com> writes:\n\n> It appeared that\n>\n> a)\n> cd /path/to && git pull git/https://....\n>\n> will fetch and checkout latest changes to working tree.  This is as\n> expected.  On the contrary\n>\n> b)\n> GIT_DIR=/path/to/.git git pull git/https://....\n>\n> will ...\n\n-ETOOLITTLEINFO.\n\nWhen you do b)\n\n - is /path/to the working tree for /path/to/.git?\n\n - where is your $(pwd)?\n\n - if your $(pwd) is different from /path/to, how are you telling git\n   where the working tree is?  are you using GIT_WORK_TREE or something?\n"},{"id":"190605","messageId":"20120502232102.GB2609@debian.b2j","threadId":"30396","inReplyTo":"7v62ceiejp.fsf@alter.siamese.dyndns.org","subject":"Re: git pull and GIT_DIR","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2012-05-02T23:21:02Z","receivedAt":"2012-05-02T23:21:02Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"It is non-bare and /path/to is the working tree.  The git pull was\nrun inside a shell and $(pwd) is $HOME.  GIT_WORK_TREE is not used.\nThis let me remember that there were some directories/files checkout\nunder $HOME that should be under /path/to.  I might recall\nincorrectly, but does it mean that it need to use the form\n\nGIT_DIR=/path/to/.git GIT_WORK_TREE=/path/to git pull url\n\nto make it to the samething as\n\ncd /path/to && git pull url\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n"}]}