2014-10-21 3 views
1

ssh를 통해 여러 개의 원격지로 푸시해야합니다.여러 ssh 리모컨으로 밀어 넣을 수 있습니까?

$ git remote -v 
stage ssh://[email protected]:/home/me/gitserve (fetch) 
stage ssh://[email protected]:/home/me/gitserve (push) 
stage ssh://[email protected]:/home/me/gitserve (push) 

$ git config -l 
user.name=kevin 
user.email=xxxx 
core.repositoryformatversion=0 
core.filemode=true 
core.bare=false 
core.logallrefupdates=true 
core.ignorecase=true 
core.precomposeunicode=true 
remote.stage.url=ssh://[email protected]:/home/me/gitserve 
remote.stage.fetch=+refs/heads/*:refs/remotes/stage/* 
remote.stage.pushurl=ssh://[email protected]:/home/me/gitserve 
remote.stage.pushurl=ssh://[email protected]:/home/me/gitserve 

을하지만 누를 때, 자식은 내 두 번째 호스트로 밀어 첫번째하지 : 여기 내 설정이다

$ git push stage master 
Counting objects: 3, done. 
Writing objects: 100% (3/3), 251 bytes | 0 bytes/s, done. 
Total 3 (delta 0), reused 0 (delta 0) 
To ssh://[email protected]:/home/me/gitserve 
    8963c70..9619fdb master -> master 
Everything up-to-date 

자식은 SSH을 통해 원격 하나 개 밀어 수 있습니까? 나는 "git : //"스키마에 대해 여러 푸시 원격을 수행 할 수 있음을 보여주는 SO의 예제를 보았지만 ssh 스키마에 여러 개의 푸시 원격을 가질 수 있는지 여부는 알 수 없습니다.

+0

확인이 답변 : http://stackoverflow.com/questions/849308를/pull-push-multiple-remote-locations # answer-3195446 – Chandu

답변

0

remote.stage.pushurl을 재정의하면 원래 값보다 우선 적용됩니다.

당신이 다른 리모컨을 눌러 다른 이름을 정의하려면 :

remote.stage2.pushurl=ssh://[email protected]:/home/me/gitserve 
remote.stage1.pushurl=ssh://[email protected]:/home/me/gitserve 

그리고 밀어 :

git push stage1 master 
git push stage2 master 
+0

나는 하나의 git push 명령을 실행할 수 있기를 바랬다. 그것이 실제로 가능하지 않다고 생각하십시오. http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations에는 사용할 수있는 기능이 있습니다. – Kevin

관련 문제