【问题标题】:git pull from fetch head / unavailable servergit pull 从 fetch head / 不可用的服务器
【发布时间】:2017-07-04 17:58:21
【问题描述】:

在失去互联网访问之前,我运行git fetch --all 来获取所有分支。

现在无法连接到服务器,我该如何处理git pull

$ git checkout feature.a
Already on 'feature.a'
Your branch is behind 'origin/feature.a' by 7 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

$ git pull
ssh: Could not resolve hostname unavailable.example.com: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

【问题讨论】:

  • pull 只是 fetch 后跟 merge。所以你现在需要做的就是git merge origin/branch mybranch?
  • 效果很好。老实说,我没有意识到 pull 执行了合并,我虽然 origin/x 去了原点那时。嗯。现在这很有意义。如果您想将此添加为答案,我会接受。我在发布其他答案之前阅读了此内容..
  • 当然可以。

标签: git git-pull git-fetch


【解决方案1】:

git pull 所做的是 fetch 后跟 merge,因此,如果您已经使用 fetch,则可以使用 git merge origin/feature.a

【讨论】:

    【解决方案2】:

    由于pull 只是fetch 后跟merge,因此您应该能够git merge origin/feature.a feature.a 并且一切顺利。

    【讨论】:

      猜你喜欢
      • 2019-02-15
      • 2012-09-14
      • 2017-11-26
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 2021-02-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多