git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git pull and GIT_DIR

From
BLbill lam <cbill.lam@gmail.com>
Date
May 2, 2012, 14:25 UTC
Message-ID
<20120502142536.GA2609@debian.b2j>
It appeared that

a) cd /path/to && git pull git/https://....

will fetch and checkout latest changes to working tree. This is as expected. On the contrary

b) GIT_DIR=/path/to/.git git pull git/https://....

will only update git repo, but leaving working tree untouched. Subsequent git status and git diff will indicate unstaged changes, apparently a commit that will revert the updated git repo. I have to do 'git reset --hard' to really update the working three.

I'm not sure if this is an intended behavior or I missed something. 
-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
Next: Junio C Hamano
Message 1 of 3 in “git pull and GIT_DIR”
  1. bill lamMay 2, 2012
  2. Junio C HamanoMay 2, 2012
  3. bill lamMay 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.