Pages

Thursday, August 26, 2010

Git newbie: Fatal : Cannot use user as an exclude file

So I started using Github. Since everyone is using it I thought, well just go ahead and use it. Should not be that hard right? Oh well, I guess people forgot to mention that you will loose some hair first before you can upload things - specially if it is related to iphone / xcode.

So after initial git commit etc, I have happily created a new xcode and tried to upload. Terminal says, sorry cant upload some items. So I Googled and found that you got to put .gitignore for iphone / xcode things.

But the problem is, I dont know where to add the ignore file. And to make it worse, I have NO IDEA how to create it. After many many search I found, to create - I got to use

nano .gitignore

And vola, now I can create a gitignore file. So I added those and saved it and then I tried to git it and there you go, a new error popped up.

fatal : cannot use /users/avi/ as an exclude file

I searched high and low what might have caused it. Tried all sorts of command only to find more and more errors. Here are a few : 
1.  fatal: bad revision 'HEAD'
2.

After many many tries, I finally found the solution 

nano ~/.gitconfig

This will bring you to the main config file which has these 

[user]
your user details

[core]
exclude users/avi/

Once I deleted those lines, I could commit and upload it right away. 

1 comment: