79697837

Date: 2025-07-11 04:50:59
Score: 0.5
Natty:
Report link

This is an old thread, but for others looking for an explanation, I'm in this situation now. After looking at the branch I want to switch to at GitHub, I can see that a single line in a file I want to switch to has different content than that line on the current branch (the one I want to switch away from). Git reports "nothing to commit" because that file is ignored.

For the OP, considering the long list of files you had, and the fact that forcing things did no harm, my guess is that you modified the files in the current branch in some trivial way, like changing the file encoding or the EOL character.

There are some suggestions about handling this situation here: Git is deleting an ignored file when i switch branches

Unfortunately, my situation is more complex. I have three branches: master, dev, and test. The file is ignored in both dev and test, so I can switch between them at will. I just can't ever switch to master. I have remotes for all three branches and I'm the only developer. I'm sure there's a way to fix this without messing things up, but I'm not sure what would insure that in the future I can merge one of the other branches into master and still push master to the remote.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • No code block (0.5):
Posted by: Bob Ray