git pull失败';错误:引用/隐藏未指向有效对象';

git pull失败';错误:引用/隐藏未指向有效对象';,git,Git,git pull出现以下错误: $ git pull error: refs/stash does not point to a valid object! error: refs/stash does not point to a valid object! error: refs/stash does not point to a valid object! error: refs/stash does not point to a valid object! Current branch

git pull出现以下错误:

$ git pull
error: refs/stash does not point to a valid object!
error: refs/stash does not point to a valid object!
error: refs/stash does not point to a valid object!
error: refs/stash does not point to a valid object!
Current branch mybranch is up to date.
我试过了,但对我不起作用。 已更新信息:

$ GIT_TRACE=1 git pull 
trace: exec: 'git-pull'
trace: run_command: 'git-pull'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'ls-files' '-u'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'config' '--bool' 'branch.mybranch.rebase'
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
trace: built-in: git 'rev-parse' '-q' '--git-dir'
trace: built-in: git 'rev-parse' '-q' '--verify' 'refs/remotes/origin/mybranch'
trace: built-in: git 'merge-base' '53512e9ce3faa7c78b6d5d7ba1a63e56b5a42a11' 'refs/heads/mybranch'
trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
trace: built-in: git 'fetch' '--update-head-ok'
error: refs/stash does not point to a valid object!
trace: run_command: 'ssh' 'git@git-master' 'git-upload-pack '\''function-test'\'''
error: refs/stash does not point to a valid object!
trace: run_command: 'rev-list' '--verify-objects' '--stdin' '--not' '--all' '--quiet'
trace: run_command: 'rev-list' '--verify-objects' '--stdin' '--not' '--all'
trace: exec: 'git' 'rev-list' '--verify-objects' '--stdin' '--not' '--all'
trace: built-in: git 'rev-list' '--verify-objects' '--stdin' '--not' '--all'
error: refs/stash does not point to a valid object!
error: refs/stash does not point to a valid object!
trace:...

最简单的办法就是彻底清除你的藏品。请注意,您需要删除两个文件,而不是一个文件,如链接解决方案中所述:

rm .git/refs/stash .git/logs/refs/stash

我刚刚遇到了这个错误。两台服务器从同一个源提取克隆;他们中只有一个人犯了这个错误。所以我挖得更深

Git的状态:

  • “git clone”将无法从具有ref的存储库中进行克隆 直接在“refs/”下,例如“refs/stash”,因为不同 验证路径在这样的refname上执行不同的操作。松开 客户端的验证,以允许此类参考
我发现其中一台服务器使用Git1.7.1,另一台使用Git1.8.5.6

值得注意的是,
fetch
命令也会失败,尽管上面的发行说明中没有明确提到


在我的特定案例中,我还发现使用Git 1.7.1的服务器实际上也有更晚的Git,但它在
PATH
环境变量中更晚

可能有意思的是,当我使用较新版本运行
git fetch
时,克隆之后甚至可以与较旧版本一起工作


最简单的解决方案就是将Git升级到1.8.5.5或更高版本。


当然,也可以放弃隐藏,但下次有人进行隐藏时,您的克隆将再次崩溃。

不确定这是否有帮助。但请尝试
git remote prune origin
请执行
$git_TRACE=1 git pull
并使用调用
git fetch
的实际refspec更新您的问题(git pull做的第一件事)。@Vimsha:
$git remote prune origin
返回
错误:refs/stash未指向有效对象
git remote prune origin
为我工作!rm.git/refs/。。。对我有效,谢谢@mockinterface.had在那之后运行
git stash
,错误消失了。我最终在我的整个.git目录中进行了文本搜索,并删除了所有引用。我在Windows上使用git gui 0.21,当我进入菜单存储库->可视化master的历史时,它显示了错误,但我这样做了,信息就消失了,希望不会再出现了