Created
May 30, 2014 17:14
-
-
Save mrlannigan/68127852a8e3418e077d to your computer and use it in GitHub Desktop.
Allow you to operate on git remotes on multiple remote systems.
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
#!/bin/bash | |
# call as if calling "git remote" | |
# | |
# ./gitRemote.sh add someuser [email protected]:someuser/repo.git | |
# ./gitRemote.sh remove someuser | |
ACTION=${@} | |
USERNAME=myuser | |
DEPLOYMENTS=("somehost.example.com /web/development1" | |
"somehost.example.com /web/development2" | |
"somehost.example.com /web/development3" | |
"someotherhost.example.com /web/development4") | |
for deployment in "${DEPLOYMENTS[@]}" | |
do | |
set -- $deployment | |
ssh ${USERNAME}@${1} "echo -n \$(hostname) ' - '; cd ${2}; pwd; git remote -v ${ACTION}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment