How to fast forward a branch when being offline

Since git pull is basically git fetch + git merge and you already did fetch and can't do it again while offline, you just need to do git merge origin/develop.

Alternatively you can do git reset --hard origin/develop which will work even if there is no fast-forward.

Edit: More options. Another way is to do git branch -f develop origin/develop before switching to it - you can't alter current branch, but you can "update" any branch to any state as long as it is not current. For current branch you have to use git reset.


git pull is a shortcut for git fetch followed by git merge.

Only git fetch accesses to the remote repository (and requires a network connection if the remote repository is on a different computer). git merge operates only with the data that already exists on your computer; it doesn't care about your network connection at all.

Since you already did git fetch all you need is to run the other half: git merge

Tags:

Git

Offline