问题
I can't commit and sync files from the GitHub for Mac App because the app says that I have to add the files previously, but I want to the app do that for me. I don't want to go to the terminal to git add -A
every time. My partner can commit and sync and the GitHub for Mac app adds the files for him.
This is the error that the app returns:
Git Error:
On branch master Changes not staged for commit: (use "git add ..." to
update what will be committed) (use "git checkout -- ..." to discard
changes in working directory)
modified: .gitignore
... more files here :)
no changes added to commit (use "git add" and/or "git commit -a")
(256)
How do I fix this?
回答1:
So if I understood your problem correctly... You don't want to have the extra step of using git add
correct? If so, then this is unavoidable with Git. This is a step that's very important, and so completely avoiding it is relatively impossible.
You might want to setup up an alias that does git commit -a
for you automatically, but really, this step is unavoidable, without either typing it or using an alias.
Also, sorry if this belongs in a comment (can't do comments on the main question for some reason).
回答2:
I only fixed this by deleting the
~/Library/Application Support/GitHub for Mac/
directory and then restarting the app. What I did was probably overkill, but it worked for me.
来源:https://stackoverflow.com/questions/11948807/github-for-mac-cant-commit-and-sync-or-just-commit-because-i-have-to-add-files