Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to push to remote git "remote: error: couldn't set 'refs/heads/homepage'"

Tags:

git

I'm getting this error while pushing to remote git. this error only occurring in my windows computer. if i try to push from mac it's working fine. i tried different solution from internet. none of them work. Any help would be great-full.

This below error is shown in git BASH and also using GUI github Desktop

remote: error: couldn't set 'refs/heads/homepage'        
To file:////192.168.0.60/***
! [remote rejected] homepage -> homepage (failed to update ref)
error: failed to push some refs to ' 
file:////192.168.0.60/***'

But in using Git GUI it shows different pop up error

Error shown in GIT GUI

The one way I tried to solve is by going to the git bare repo on \192.168.0.62***\refs\heads and deleting the branch name file (homepage) and then it work successfully.

But I don't want to manually delete that file every time I push...

like image 985
jay patel Avatar asked Nov 04 '25 05:11

jay patel


2 Answers

This is the same error just in a different wording.

To deal with concurrency issues, git updates files as follows: it creates a lock file (*.lock) writes any new content into the lock file and renames the lock file to the original file. (Note that the shell message says "set" not "write" or "update".)

This means, that git counter-intuitively needs permission to delete the old file. You should check the permissions the updating git process has. Which one that is depends on your used protocol.

like image 91
Paul-Dirac- Avatar answered Nov 05 '25 20:11

Paul-Dirac-


We had the same issue. It looks like you are using a remote server. We found that if you click the 'Yes' button to retry it will eventually succeed and the operation will complete successfully. You don't seem to get that retry option when working from the command line (Git bash). For us it took around 15 seconds for the retry to finally succeed. I believe we are using Samba remote file system connected to Windows 10.

like image 23
Clay Budin Avatar answered Nov 05 '25 21:11

Clay Budin