Created
April 24, 2025 13:33
-
-
Save neatshell/0b66098a3d479cc349cddf0949c3d19e to your computer and use it in GitHub Desktop.
A simple script to relink every local branch with remote
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
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/); do | |
git branch --set-upstream-to=origin/$branch $branch 2>/dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment