LoginSignup
19
11

More than 3 years have passed since last update.

【Git】別のブランチにpushしたいとき

Posted at

【Git】別のブランチにpushしたいとき

  • gitで、ローカルのブランチから別名のリモートブランチにPUSHしたいときのやり方

方法

git push origin <PUSHしたいローカルブランチ名>:<PUSH先リモートブランチ名>

解説

  • もともとGitのpushの際の git push origin <ブランチ名>は、git push origin <ブランチ名>:<ブランチ名>の省略形であり、<src>:<dst>の関係性になっている
  • 上記のようになっているので、srcの位置に送りたいブランチ、dstに送り先ブランチにしてあげると、別名のブランチにPUSHできる
19
11
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
19
11