Created
December 5, 2020 15:54
-
-
Save stephenscaff/ba7a17c909555ce9d172ce8aa1022bb4 to your computer and use it in GitHub Desktop.
Decent Git Pull Flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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