Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git error : Couldn't set refs/heads/master

Tags:

git

I'm having this problem regardless of a new clone , reinstalling git extension or even deleting the local repository . Any helps ? The full error log is this

git push --recurse-submodules=check --progress "origin" refs/heads/master:refs/heads/master
Counting objects: 133, done.
Delta compression using up to 4 threads.
Total 94 (delta 77), reused 0 (delta 0)
error: Couldn't set refs/heads/master
To M:/Madsanda Dev
 ! [remote rejected] master -> master (failed to write)
error: failed to push some refs to 'M:/remote folder'
Done

The only thing I noticed here is

git push --recurse-submodules=check --progress "origin" refs/heads/master:refs/heads/master

, is usually

git push --recurse-submodules=check --progress "origin" master:master

Please advice , thanks .

like image 810
RRttcc1234 Avatar asked Nov 29 '25 10:11

RRttcc1234


2 Answers

I've had this error when my files were on a network drive folder.. Copying my project into local folder with full permissions resolved it.

like image 137
boateng Avatar answered Dec 01 '25 03:12

boateng


For me, closing my IDE (VS) fixed the issue.

like image 33
RnDrx Avatar answered Dec 01 '25 03:12

RnDrx