Created
February 18, 2026 05:41
-
-
Save joncode/64b8162e33e720dbe8d075b26e500bcc to your computer and use it in GitHub Desktop.
Quick bash script to make upstream branches for a dev/qa/prod codebase
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 branch dev main && git push -u origin dev | |
| git branch jg main && git push -u origin jg | |
| git branch qa main && git push -u origin qa | |
| git branch prod main && git push -u origin prod |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fetch latest refs
git fetch origin
create local tracking branches
git switch -c dev --track origin/dev
git switch -c jg --track origin/jg
git switch -c qa --track origin/qa
git switch -c prod --track origin/prod
(main usually already tracks, but this makes it explicit)
git switch main
git branch --set-upstream-to=origin/main main