1
0

More than 1 year has passed since last update.

Github で、異なるリポジトリの別のブランチに push する

Posted at

やりたいこと

(注意: リポジトリは適当な例です)

リポジトリ A にある branch-a ブランチの内容を、
リポジトリ B にある branch-b ブランチに push したい。

やりかた

  1. push 元のリポジトリ A を clone し、そこに cd する

    git clone git@github.com:example-a/a.git
    cd a
    
  2. push 先のリポジトリ B をリモートリポジトリに追加する

    git remote add b git@github.com:example-b/b.git
    
  3. push 元のブランチ名と、push先のリモートリポジトリ名・ブランチ名を指定して push する

    git push b branch-a:branch-b
    

謝辞

thanks to @yasuraok

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0