github-for-mac-issues icon indicating copy to clipboard operation
github-for-mac-issues copied to clipboard

Can't commit & sync or just commit because I have to add files before

Open torhector2 opened this issue 12 years ago • 14 comments

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 ..." 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 could I fix this?

Thaks.

torhector2 avatar Aug 14 '12 08:08 torhector2

+1

meerestier avatar Sep 12 '12 08:09 meerestier

+1

celiasmith avatar Nov 05 '12 21:11 celiasmith

+1

kbray avatar Jan 09 '13 20:01 kbray

+1

robwasmann avatar Jan 09 '13 20:01 robwasmann

+1

ghost avatar Jan 19 '13 23:01 ghost

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.

robwasmann avatar Jan 20 '13 02:01 robwasmann

+1

jiangubaixiong avatar Mar 22 '13 03:03 jiangubaixiong

+1

Melros avatar Apr 28 '13 18:04 Melros

+1

knx avatar May 22 '13 10:05 knx

Well, this is weird. I've modified some entries in my .gitignore file and this behaviour stopped.

knx avatar May 23 '13 10:05 knx

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 !

hlandry avatar Jun 09 '13 11:06 hlandry

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.

claudioromano avatar Jul 02 '13 19:07 claudioromano

+1 (although removing the offending line from .gitignore fixed it, this error is just bad UI)

hn3000 avatar Mar 27 '14 11:03 hn3000

I added "*.xcuserstate" to my gitignore file and it worked. Many thanks.

nuhuxi avatar Aug 22 '14 00:08 nuhuxi