Last active
December 21, 2015 10:00
-
-
Save iManu/4a1fadde8b958bb3b5bd to your computer and use it in GitHub Desktop.
set git backup remotes
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
## 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