Created
February 18, 2022 15:59
-
-
Save oliverspryn/e267f9881b7ab0279cf6b4208c21fd5e to your computer and use it in GitHub Desktop.
Set a Git branch's upstream with a single command
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
git checkout origin branch_that_is_already_on_origin | |
git upstream | |
# To use, add this to your ~/.gitconfig file | |
[alias] | |
upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment