After cloning from remote git repository (at bettercodes) I made some changes, commited and tried to push:
git push origin master
Errors
Before pull you need to clean your local changes. following command help me to solve.
git remote prune origin
and then after
git pull origin develop
Hopes this helps!
This is probably resolved by now. But here is what worked for me.
Location:
If locked repository is on the server-side:
If locked repository is local only:
Run this command:
git update-server-info
Fix the permissions on your (remote or/and local) repository if you have to. In my case I had to chmod
to 777
and chown
to apache:apache
Try to push again from the local repository:
git push
Update:
You might need to edit your ~/.netrc file:
Original answer:
Why did you disable ssl? I think this might have to do with you not being able to push via https. I'd set it back and try to push again:
git config –global http.sslVerify true
This is what I did to get rid of all the lock ref issues:
git gc --prune=now
git remote prune origin
This is probably what you only need to do too.
In case of bettercodes.org, the solution is more poetic - the only problem may be in rights assigned to the project members. Simple members don't have write rights! Please make sure that you have the Moderator or Administrator rights. This needs to be set at bettercodes.org at the project settings by an Administrator, of course.
For me this worked:
git remote prune origin
Since this answer seems to help a lot of people, I dug a little bit into what actually happens here. What this will do is remove references to remote branches in the folder .git/refs/remotes/origin
. So this will not affect your local branches and it will not change anything remote, but it will update the local references you have to remote branches. It seems in some cases these references can contain data Git cannot handle correctly.