-
-
Save neetsdkasu/31a2e07c355199d22581d02482c38a92 to your computer and use it in GitHub Desktop.
リポジトリコピー・・・
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
#!/bin/sh | |
echo '#!/bin/sh' > doitdoit.sh | |
git branch -a | grep -v master|HEAD | sed -r -e s/.*origin\\/\(.*\)/git\ branch\ \\1\ origin\\/\\1/ >> doitdoit.sh | |
git remote | grep -v origin | sed -r -e s/\(.*\)/git\ push\ \\1\ --all\\ngit\ push\ \\1\ --tags/ >> doitdoit.sh | |
./doitdoit.sh | |
rm doitdoit.sh | |
grep
もsed
も難しい、全くわからん・・・
特にsed
がイミフ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
リモートのhogehogeサイトに置いてあるリポジトリhogeを
別のリモートのfugafugaとpiyopiyoにコピーしたいときに使うスクリプト
git clone git@hogehoge~~/hoge.git cd hoge git remote add fuga git@fugafuga~~/hoge.git git remote add piyo git@piyopiyo~~/hoge.git
ここで
を実行
pick.shは origin/* のブランチからローカルブランチを作ってorigin以外のリモートに
push --all
とpush --tags
を実行する doitdoit.sh というスクリプトを生成して それを実行する