git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
Kcelone
V2EX  ›  git

git 异常: 执行 git pull 出现 Your configuration specifies to merge with the ref 'refs/heads/xxx' , but no such ref was fetched

  •  
  •   Kcelone · Jan 9, 2019 · 10764 views
    This topic created in 2707 days ago, the information mentioned may be changed or developed.

    出现此类问题,你可以执行一下 git status,会发现 On branch xxx Your branch is based on 'origin/yyy', but the upstream is gone. (use "git branch --unset-upstream" to fixup),可以根据提示执行该命令,然后再执行 git push --set-upstream origin xxx 即可。

    回头解释一下: 出现此类问题是由于你修改了本地分支 xxx -> yyy,然后你又修改了远程的 xxx -> yyy,由于配置文件进行了配置,则此时本地的 yyy 也会将代码提交到远程的 xxx 中,但是远程的 xxx 已经被你修改掉了,不存在了,所以才会出现这个提交错误。解决办法就是解绑然后重新绑定新的远程分支即可。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3250 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:58 · PVG 19:58 · LAX 04:58 · JFK 07:58
    ♥ Do have faith in what you're doing.