Created
July 14, 2022 12:30
-
-
Save stand-sure/612e781ea7a175b9aa9e41aaf35e76d8 to your computer and use it in GitHub Desktop.
Git catch up current branch
This file contains hidden or 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 | |
| # checkout-pull-prune.sh | |
| branchName=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p') | |
| git fetch origin "$branchName:$branchName" | |
| git merge "$branchName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment