Last active
August 29, 2015 14:16
-
-
Save davidrenne/6f04054aeadffea496ee to your computer and use it in GitHub Desktop.
Git Branch Management for multiple repositories in a project
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
#Repeat these scripts if you want to do branch management across similar repos in the same project obviously change your path /usr/local/repository & /usr/local/repository2 and copy more as needed | |
alias switch_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository && git fetch origin && git checkout $response && cd /usr/local/repository2 && git fetch origin && git checkout $response' | |
alias create_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository/ && git branch $response && git push origin $response && git checkout $response && cd /usr/local/repository2/ && git branch $response && git push origin $response && git checkout $response' | |
alias delete_branch='echo -n "Git branch name?>" && read response && cd /usr/local/repository/ && git checkout $response && git checkout master && git branch -d $response && git push origin :$response && cd /usr/local/repository2/ && git checkout $response && git checkout master && git branch -d $response && git push origin :$response' | |
alias tag='echo -n "Version Number (1.0.1)?>" && read response && cd /usr/local/repository/ && git tag -a "v""$response" -m $response && git push origin "v""$response" && cd /usr/local/repository2/ && git tag -a "v""$response" -m $response && git push origin "v""$response"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment