2016-06-17 8 views
3

私は2つのリモートを持っています:上流と原点。上流は私が押し込めないものです。起源は私自身のレポです。どのようにして上流からすべてのブランチを取り出してから元に戻すことができますか? 私は試しました:gitは1つのリモートから別のリモートにすべてのブランチをプッシュ

git fetch upstream 
git push --all origin 

しかし、動作しません。

+0

は、リモートのURLを確認してください 'gitのリモートショー' – Gregg

+1

とのは、[この](http://stackoverflow.com/a/37797245/3723423)助けることができますか? – Christophe

答えて

0

希望はこのことができます:

git remote add your-new-origin url-to-repo/repo.git 
git push --all your-new-origin //pushes all branches 
git push --tags your-new-origin //pushes all tags 
7

あなたはあまりにも

あなたは次のフローがあるでしょう--mirrorオプションを使用して、上流のレポのクローンを作成しようとし、その後--mirrorオプションを使用して新しいリモートにプッシュすることもできます。

git clone <upstream-repo-url/repo.git> --mirror 
git remote add <your-remote-name> <your-remote-url/repo.git> 
git push <your-remote-name> --mirror 
関連する問題