
git remote set-url --add origin URL を使う。.git/configのremote "origin"にURLを二つ設定します(すでに設定されている場合は一つ追加になる)$ vi .git/config
$ cat .git/config
...
[remote "origin"]
url = git@example.org:xxxx/xxxx.git
url = git@example.com:yyyy/yyyy.git ←追加した
fetch = +refs/heads/*:refs/remotes/origin/*
$ git remote -v
origin git@example.org:xxxx/xxxx.git (fetch)
origin git@example.org:xxxx/xxxx.git (push)
origin git@example.com:yyyy/yyyy.git (push) ←追加されている
.git/configを直接編集するのではなく、git remote set-urlに--addオプションを付けて実行してもいいです。$ cat .git/config # 修正前を確認しておく
$ git remote set-url --add origin git@example.com:yyyy/yyyy.git
$ cat .git/config # 追加されたかを確認する
$ cat .git/config # 削除前を確認しておく
$ git remote set-url --delete origin git@example.com:yyyy/yyyy.git
$ cat .git/config # 削除されたかを確認する
Gitのremoteを二箇所にして同じ内容をpushできるだろうか