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

Why git silently replaces untracked files?

From
Iigor.mikushkin <igor.mikushkin@gmail.com>
Date
Mar 25, 2011, 14:52 UTC
Message-ID
<1301064754576-6207950.post@n2.nabble.com>
Why git silently replaces untracked files?

# mkdir test.git # mkdir 1 # mkdir 2 # echo 1 > 1/test # echo 2 > 2/test # cd test.git # git init --bare # cd .. # git clone test.git # cp -r test/.git 1 # cp -r test/.git 2 # cd 1 # git add test # git commit -am 1 # git push origin master # cd ../2 # git pull # cat test 1

In my opinion it is wrong behavior. I've just lost important file due to it.

Should not "git pull" fail here? Anyhow it looks more correct then silent replacing.

Thanks, Igor

-- View this message in context: http://git.661346.n2.nabble.com/Why-git-silently-replaces-untracked-files-tp6207950p6207950.html Sent from the git mailing list archive at Nabble.com.

Next: Jeff King
Message 1 of 8 in “Why git silently replaces untracked files?”
  1. igor.mikushkinMar 25, 2011
  2. Jeff KingMar 25, 2011
  3. igor.mikushkinMar 25, 2011
  4. Jeff KingMar 25, 2011
  5. 1/4 t7607: mark known breakage in test 11 as fixedJeff King, Mar 25, 2011
  6. 2/4 t7607: clean up stray untracked fileJeff King, Mar 25, 2011
  7. 3/4 merge: merge unborn index before setting refJeff King, Mar 25, 2011
  8. 4/4 pull: do not clobber untracked files on initial pullJeff King, Mar 25, 2011

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.