RRttcc1234
RRttcc1234

Reputation: 59

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

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 .

Upvotes: 3

Views: 11944

Answers (5)

p00rimpulsecontrol
p00rimpulsecontrol

Reputation: 1

Enough hints here to fix my problem with a repo on UNC share. NTFS permissions for non-admins were set to Write/Change. Elevating to Full control on the folder eliminated the error.

Upvotes: 0

RnDrx
RnDrx

Reputation: 250

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

Upvotes: 3

Chris V
Chris V

Reputation: 103

I'm using Source Tree. Running in Administrator mode worked for me.

Upvotes: 1

boateng
boateng

Reputation: 898

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.

Upvotes: 3

First Zero
First Zero

Reputation: 22376

You need to create a file HEAD inside .git folder and write in that file ref: refs/heads/master

Example:

echo ref: refs/heads/master >.git/HEAD

Upvotes: 0

Related Questions