Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用git从master branch提取?_Git_Error Handling_Pull - Fatal编程技术网

如何使用git从master branch提取?

如何使用git从master branch提取?,git,error-handling,pull,Git,Error Handling,Pull,我试图从我的主分支中提取,但收到错误消息: $ git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin error: cannot lock ref 'refs/remotes/o

我试图从我的主分支中提取,但收到错误消息:

$ git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin 

error: cannot lock ref 'refs/remotes/origin/navigation': is at 1234566753 but expected 5434623423 From https://bitbucket.org/myproject  ! 12345..8f1b648  navigation -> origin/navigation  (unable to update local ref) Completed with errors, see above
我能做什么?

尝试运行:

 git gc --prune=now

并删除
.git/refs/remote/origin

这是否删除了任何重要内容?@fala如果您有疑问,请备份您为什么使用
--这里没有可选锁?(它应该像中一样工作,什么也不做;锁不是可选的,因此没有可选的锁可以省略,但它也是不必要的。)通常不应该发生此特定错误,如果重复
git fetch
操作,则不应该重复此错误。