5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git rebase -i の使い方

Posted at

gitを使ってるとよく聞くrebase
コミット履歴を改変してるので基本的には使わないほうがいいと思います。
でもローカルでぐだぐだになってしまっている履歴を意味のある単位に整理しなおしてからpushするためには使ってもいいと感じました。

整理したい履歴の数を指定して
git rebase -i HEAD~4

これで出てきたコミットに対して、
pickとなっているものが適用するコミット。
pickをsにしてメッセージを書き直す。
pickをfにしてメッセージはpickのものを使用する。

この使い方なら気楽にやれると思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?