github-for-mac-issues
github-for-mac-issues copied to clipboard
Can't commit & sync or just commit because I have to add files before
Hi,
I can't commit & 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 got to the terminal to git add -A everytime. My partner can commit & sync and the GitHub for Mac add 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
modified: .gitignore
... more files here :)
no changes added to commit (use "git add" and/or "git commit -a") (256)
How could I fix this?
Thaks.
+1
+1
+1
+1
+1
In my case I had to add the following 2 lines to .gitignore in the base directory.
*.xcuserstate XXX.xcodeproj/project.xcworkspace/xcuserdata/xxx.xcuserdatad/UserInterfaceState.xcuserstate
You probably don't need to second line, but it worked for me. Your line will look different of course. This was a user state file associated with Xcode. Your random file (causing problems) could be something entirely different. In the Github app it actually listed this file as being updated, so you can choose to ignore it right from the app and it will update the .gitignore file automatically. I hope this helps! It was a bit of a pain to figure out.
+1
+1
+1
Well, this is weird. I've modified some entries in my .gitignore file and this behaviour stopped.
I think this happens when you add something in .gitignore that is already in the repository.
When you do that the error is there. If you remove the line, the error is gone.
This error does not occur on the command line version !
Thanks, I had the same problem. I've found the solution reading this. I've added a folder to .gitignore a time ago, but one file was already in the repository... since it didn't have any change it never showed up, so I've never had this problem. The solution was to commit everything but this file. That worked for me.
After that, I've removed the the file from my local copy and commited the change. Hope this helps.
+1 (although removing the offending line from .gitignore fixed it, this error is just bad UI)
I added "*.xcuserstate" to my gitignore file and it worked. Many thanks.