Search code examples
gitgit-pullgit-fetch

git pull from fetch head / unavailable server


Before losing internet access I ran git fetch --all to fetch all branches.

With a connection to the server now unavailable, how can I do a 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.

Solution

  • What git pull does is a fetch followed by a merge, so, if you already did the fetch, you can do git merge origin/feature.a.