LoginSignup
2
0

More than 5 years have passed since last update.

Git で今いるブランチにコミットしたものを別ブランチに移す

Posted at

一連のコマンド

移す先のブランチを今いるブランチから作成

git checkout -b another

元のブランチに戻る

git checkout rootBranch

元のブランチでリセットする

git reset origin/rootBranch --hard

例えば master から移すケースなら

git checkout -b another
git checkout master
git reset origin/master --hard
2
0
1

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
2
0