“Git”的版本间的差异
来自qingwei personal wiki
(→git pull: unable to update local ref) |
(→git pull/fetch: unable to update local ref) |
||
第1行: | 第1行: | ||
== 常见错误 == | == 常见错误 == | ||
=== git pull/fetch: unable to update local ref === | === git pull/fetch: unable to update local ref === | ||
− | + | * 现象 | |
<source lang="shell"> | <source lang="shell"> | ||
[qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch | [qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch | ||
第9行: | 第9行: | ||
! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref) | ! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref) | ||
</source> | </source> | ||
− | + | * 删除文件 | |
<source lang="shell"> | <source lang="shell"> | ||
rm -rf .git/refs/remotes/origin/bugfix/haofan | rm -rf .git/refs/remotes/origin/bugfix/haofan | ||
+ | </source> | ||
+ | * 新的问题 | ||
+ | <source lang="shell"> | ||
+ | [qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch | ||
+ | |||
+ | error: 'refs/remotes/origin/bugfix/haofan/device-key' exists; cannot create 'refs/remotes/origin/bugfix/haofan' | ||
+ | From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager | ||
+ | ! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref) | ||
+ | error: some local refs could not be updated; try running | ||
+ | 'git remote prune origin' to remove any old, conflicting branches | ||
+ | </source> | ||
+ | * 按提示删除 | ||
+ | <source lang="shell"> | ||
+ | git remote prune origin | ||
</source> | </source> |
2017年12月19日 (二) 03:25的版本
常见错误
git pull/fetch: unable to update local ref
- 现象
[qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch
error: there are still refs under 'refs/remotes/origin/bugfix/haofan'
From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager
! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref)
- 删除文件
rm -rf .git/refs/remotes/origin/bugfix/haofan
- 新的问题
[qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch
error: 'refs/remotes/origin/bugfix/haofan/device-key' exists; cannot create 'refs/remotes/origin/bugfix/haofan'
From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager
! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref)
error: some local refs could not be updated; try running
'git remote prune origin' to remove any old, conflicting branches
- 按提示删除
git remote prune origin