When I try and pull from github I get a strange error. Can I bypass this or force it? I have used sudo before which I suspect would work however this caused other problems.
Asked
Active
Viewed 9,351 times
3
-
2Do you have write permission in the directory from where you ran `git clone`? – Benjamin Bannier Jun 11 '12 at 08:40
-
http://stackoverflow.com/questions/1209902/git-checkout-and-reset-on-windows-occasionally-shows-random-files-have-changed doesn't help? – VonC Jun 11 '12 at 09:00
-
@VonC: Since he mentions sudo he probably works under Linux or OS X. – Benjamin Bannier Jun 11 '12 at 09:30
-
@honk good point. Then your permission issue is certainly closer to the mark. – VonC Jun 11 '12 at 09:56
-
You probably don't want to use sudo in connection with Git in your own development environment. – Eric Walker Mar 11 '13 at 05:47
2 Answers
5
I had this problem as well. I solved it by changing the ownership of the directories to the user I was trying to git pull with:
sudo chown -R anthony:anthony *
I ran that at the root of my git tracked directory to make sure all the files were owned by the correct user.

penner
- 2,707
- 1
- 37
- 48
4
In my case it was having sublime text open with the git controlled directory added as a folder in the sublime project. After closing sublime I was able to switch branches without a problem.

Clintm
- 4,505
- 3
- 41
- 54