Skip to content

Instantly share code, notes, and snippets.

@stephenscaff
Created December 5, 2020 15:54
Show Gist options
  • Save stephenscaff/ba7a17c909555ce9d172ce8aa1022bb4 to your computer and use it in GitHub Desktop.
Save stephenscaff/ba7a17c909555ce9d172ce8aa1022bb4 to your computer and use it in GitHub Desktop.
Decent Git Pull Flow
#!/bin/bash
# First, run a fetch to update all origin/<branch> refs to latest:
git fetch --all
# Backup your current branch:
git checkout -b backup-master
# Then, you have two options:
git reset --hard origin/master
# OR, If you are on some other branch:
git reset --hard origin/<branch_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment