Method 1:
Syntax :
git config alias.pushall '!f() { git push <remote-name> $1 && git push <remote-name> $1; }; f'
Example :
git config alias.pushall '!f() { git push origin $1 && git push openvpn $1; }; f'
Method 2:
Edit .git/config
[alias]
pushall = "!f() { git push origin $1 && git push openvpn $1; }; f"
cat .git/config[openvpn]$cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "openvpn"]
url = ssh://
fetch = +refs/heads/*:refs/remotes/openvpn/*
[alias]
pushall = "!f() { git push origin $1 && git push openvpn $1; }; f"
Add more repository
Example:
git remote add vpn ssh://gogo@192.168.0.1:/home/sasa/git/vpn.git
Reference:
0 意見:
張貼留言