LoginSignup
1
1

More than 5 years have passed since last update.

gitで一部のcommitを抜きたい

Posted at

PRしたときに、一部抜いてほしいと言われて操作してみました。

git_modify.png

この図のbとdを抜いてみます。

まずeからブランチfを作ります。

% git branch f

aまで巻き戻します。

% git reset --hard <aのid>

cとeを反映します。

% git cherry-pick <cのid>
% git cherry-pick <eのid>

これでbとdが無い状態になりました。

他にも方法ありそうですが、とりあえず忘れないように。

1
1
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
1
1