Why does 'git commit' not save my changes?

前端 未结 12 1610
星月不相逢
星月不相逢 2020-11-29 15:16

I did a git commit -m \"message\" like this:

> git commit -m \"save arezzo files\"
# On branch master
# Changes not staged for commit:
#   (u         


        
12条回答
  •  一个人的身影
    2020-11-29 15:32

    I had a very similar issue with the same error message. "Changes not staged for commit", yet when I do a diff it shows differences. I finally figured out that a while back I had changed a directories case. ex. "PostgeSQL" to "postgresql". As I remember now sometimes git will leave a file or two behind in the old case directory. Then you will commit a new version to the new case.

    Thus git doesn't know which one to rely on. So to resolve it, I had to go onto the github's website. Then you're able to view both cases. And you must delete all the files in the incorrect cased directory. Be sure that you have the correct version saved off or in the correct cased directory.

    Once you have deleted all the files in the old case directory, that whole directory will disappear. Then do a commit.

    At this point you should be able to do a Pull on your local computer and not see the conflicts any more. Thus being able to commit again. :)

提交回复
热议问题