I use git on my Windows 7 machine by clicking on the shared folder on the Server 2008 machine. This has been working fine for the past 6 months. However, as of yesterday, I can no longer push the remote repo. Every time I try, I get the following:
$ git push
Counting objects: 39, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 8.42 KiB, done.
Total 23 (delta 15), reused 0 (delta 0)
Unpacking objects: 100% (23/23), done.
error: Couldn't set refs/heads/my-branch
To //my-server/Code/my-project.git
error: failed to push some refs to '//my-server/Code/my-project.git
Google for the error "could not push some errors" gives different results that you did not transfer first (I’m completely updated) and do not have the necessary rights (I have full access to everything and can create / delete / edit files in the remote repo via conductor).
Then I came across this blog post at http://henke.ws/post.cfm/error-failed-to-push-some-refs , which mentions that you may have to run some cleanup commands on the remote repository. So I ran git gc in a remote repository:
$ git gc
Counting objects: 3960, done.
Compressing objects: 100% (948/948), done.
Writing objects: 100% (3960/3960), done.
Total 3960 (delta 2971), reused 3942 (delta 2964)
And so, I can click again!
$ git push
Counting objects: 39, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 8.42 KiB, done.
Total 23 (delta 15), reused 0 (delta 0)
Unpacking objects: 100% (23/23), done.
To //my-server/Code/my-project.git
8153afd..1385d28 my-branch -> my-branch
The problem is that now I need to run gc in the remote repository every time I want to push . If I do not, I will again return to the error "did not click some corrections."
So why is my repo so ruined? How can I fix the problem forever?