Created
March 15, 2021 21:07
-
-
Save cblecker/41ad288fcaaf6fbca8d2674b8b2534c8 to your computer and use it in GitHub Desktop.
git aliases for working with default branches
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
git config --global alias.default '!git symbolic-ref refs/remotes/origin/HEAD | sed '"'"'s:^refs/remotes/origin/::'"'" | |
git config --global alias.checkout-main '!git checkout $(git default)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment