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

Potential Same Name Bug

From
KSKevin Smith <noiz77@gmail.com>
Date
Sep 12, 2016, 23:29 UTC
Message-ID
<CAOY7EmCYjajQPPAVhAhzt7g0yA=QH2R9HZEAhztUo2JbfSiCwQ@mail.gmail.com>

I hit an issue in Git today that seemed to be a bug. Basically what happened is in our master branch we had two files, one named something like "file_NAME.png" and another named "file_name.png" in the same folder. In the develop branch in the same repo we had removed the "file_NAME.png" file so that only the "file_name.png" file was left. If I clone the repo so I get master and then do "git checkout develop" I would see when running "git status" that I would have this message:

On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
        deleted:    file_name.png
no changes added to commit (use "git add" and/or "git commit -a")

So when I move from master to develop that status would come up. If I ran "git reset --hard" I would no longer have that message. I also saw that when I do a git clone and specify to clone the develop branch that I would not see the git status above. Is this an issue where if one branch has two files of the same name where one gets removed that it will remove both instances of that file in another branch when you switch to it? I fixed this issue in our repo by removing the "file_NAME.png" file in the master branch, but it seems like this should be handled better in the case I described.

Next: Andrew Ardill
Message 1 of 2 in “Potential Same Name Bug”
  1. Kevin SmithSep 12, 2016
  2. Andrew ArdillSep 13, 2016

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.