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

Re: git 1.4.0 usability problem

From
RARyan Anderson <ryan@michonline.com>
Date
Jun 18, 2006, 16:43 UTC
Message-ID
<20060618164300.GI25520@h4x0r5.com>
In-Reply-To
<449557B6.1080907@garzik.org>
On Sun, Jun 18, 2006 at 09:40:06AM -0400, Jeff Garzik wrote:
Show 19 quoted lines
> Now that kernel 2.6.17 is out, I updated all my repositories to be based 
> against that kernel.  And for each repository I updated, my merge was 
> rejected, due to an error similar to:
> 
> >fatal: Untracked working tree file '.gitignore' would be overwritten by 
> >merge.
> 
> I am only able to merge if I delete files in the working directory, so 
> that git stops complaining on merge.
> 
> This behavior is new with git 1.4.0, which Fedora Extras just added.  I 
> verified that merges work as expected in git 1.3.3, the last version 
> Fedora Extras shipped prior to 1.4.0.
> 
> This behavior is a definite regression, that impacts workflow :(
> 
> Here is how to reproduce:
> 
> git clone -l $url/torvalds/linux-2.6.git tmp-2.6

At this point you have master checked out, and recorded properly in the index.

> cd tmp-2.6
> cp .git/refs/tags/v2.6.12 .git/refs/heads/tmp
> git checkout -f tmp

Here, you throw that index away, ignore the contents of the working tree, and checkout tmp.

> git pull . master
> # watch OBVIOUS FAST-FORWARD MERGE complain about untracked
> # working tree files

At this point, you have a working tree containing files leftover from the checkout of master, but which are totally unknown to the 2.6.12 tree, and so are untracked. The fast-forward is trying hard not to overwrite things it shouldn't be messing with, and so complains.

The fix is to drop the "-f" from git checkout, and things should work correctly. ("-f" should really not be a normal thing to use. For switching branches, "git checkout" should be sufficient, and should result ina working tree that doesn't contain nearly as many potential conflict sources.

-- 
Ryan Anderson
  sometimes Pug Majere
Previous: Jeff GarzikNext: Ryan Anderson
Message 2 of 17 in “git 1.4.0 usability problem”
  1. Jeff GarzikJun 18, 2006
  2. Ryan AndersonJun 18, 2006
  3. Ryan AndersonJun 18, 2006
  4. Junio C HamanoJun 18, 2006
  5. Junio C HamanoJun 18, 2006
  6. Jeff GarzikJun 18, 2006
  7. Junio C HamanoJun 19, 2006
  8. Jeff GarzikJun 20, 2006
  9. Ryan AndersonJun 20, 2006
  10. Junio C HamanoJun 20, 2006
  11. checkout -f: do not leave untracked working tree files.Junio C Hamano, Jun 20, 2006
  12. Santi BéjarJun 20, 2006
  13. Junio C HamanoJun 20, 2006
  14. Alexander LitvinovJun 20, 2006
  15. Junio C HamanoJun 20, 2006
  16. Alexander LitvinovJun 20, 2006
  17. Carl WorthJun 20, 2006

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.