git从获取头/不可用的服务器拉

时间:2017-02-15 21:11:34

标签: git git-pull git-fetch

在失去互联网访问权限之前,我运行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.

2 个答案:

答案 0 :(得分:4)

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

答案 1 :(得分:0)

由于pull只是fetch后跟merge,因此您应该能够git merge origin/feature.a feature.a并且可以继续。