Git error on git pull (unable to update local ref)

2019-01-21 10:43发布

I only have branch master and im getting this error every time i try to "git pull":

error: Couldn't set refs/remotes/origin/master
From /var/lib/git/xxx/project
 ! a0f80ea..49177a3  master     -> origin/master  (unable to update local ref)

and when i do "git pull origin master" i get:

error: Couldn't set ORIG_HEAD
fatal: Cannot update the ref 'ORIG_HEAD'.

i have been searching but cant find why

11条回答
够拽才男人
2楼-- · 2019-01-21 11:08

I solved as below:

git remote prune origin

查看更多
Emotional °昔
3楼-- · 2019-01-21 11:08

I had the same issue on my debian server as the disk is full. No temp file could be created as no space left on device. After cleaning some files, it worked out fine.

查看更多
相关推荐>>
4楼-- · 2019-01-21 11:12

This error with (unable to update local ref) can also happen if you have changed passwords recently and there's some fancy stuff integrating your Windows and Linux logins.

查看更多
欢心
5楼-- · 2019-01-21 11:14

Speaking from a PC user - Reboot.

Honestly, it worked for me. I've solved two strange git issues I thought were corruptions this way.

查看更多
三岁会撩人
6楼-- · 2019-01-21 11:19

This happened to me on OSX where I use a case insensitive file system. Somehow another developer pushed a branch with the same name but different case: My-Branch vs my-branch.

I already had My-Branch checked out and got the error "unable to update local ref" when I did a pull probably because the file system thinks My-Branch == my-branch.

Since we use Github I could solve the problem by deleting one of the branches via Github's GUI.

查看更多
登录 后发表回答