git使ってて都合上push先が2つになることがあって、毎回
$ git push # originにpush $ git push origin2 # それ以外にpushする必要のあるレポジトリ
・・が面倒なので何とかしたかった、探したらあった。
.git/config
に
[remote "origin"] url = git@github.com:ongaeshi/milkode.git fetch = +refs/heads/*:refs/remotes/origin/*
一行追加すればOK。
[remote "origin"] url = git@github.com:ongaeshi/milkode.git + url = git@github.com:hogehoge/hogehoge.git fetch = +refs/heads/*:refs/remotes/origin/*
git push
の度に2つのレポジトリにpushしてくれる。pullの時はどうなるのだろう?
$ git push
しばらく使ってみる。