Skip to content

Instantly share code, notes, and snippets.

@iManu
Last active December 21, 2015 10:00
Show Gist options
  • Save iManu/4a1fadde8b958bb3b5bd to your computer and use it in GitHub Desktop.
Save iManu/4a1fadde8b958bb3b5bd to your computer and use it in GitHub Desktop.
set git backup remotes
## FILE : ~/.bashrc
## Add remotes for backups
#
# first, init bashrc : $ . ~/.bashrc
#
# USE : $ setallremotes projname.git
# THEN : $ git push all master
#
function setallremotes () {
local SERV_CHEIL='/Volumes/DIVISION/00_CHEIL/06_OPERATIONS/10_Technique/01_DepotGit/'
local SERV_MACMINI='ssh://git@106.102.3.204:/Users/git/repository/'
local SERV_GITLAB='http://106.102.3.26/macmini/'
# origin repo
git remote add all $SERV_GITLAB$1
# backup repos
git remote set-url --add --push all $SERV_MACMINI$1
git remote set-url --add --push all $SERV_CHEIL$1
git remote -v
}
export -f setallremotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment