0
0

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 3 years have passed since last update.

git リベースとは

Last updated at Posted at 2021-11-05

変更を統合する際に、履歴をきれいに統合するためにつかうのがリベース
他のブランチをマージし、履歴まで整える事ができる

git rebase <ブランチ名>

気をつけること

githubにプッシュしたコミットをリベースするのはNG
→プッシュできなくなる

マージとの使い分け

作業履歴を残したい場合はマージを使う
履歴をきれいにしたい場合はリベースを使う

  • プッシュしていないローカルの変更にはリベースを使う
  • プッシュした変更はマージを使う
  • コンフリクトが起きそうな場合はマージを使う→リベースでは複数コミットでコンフリクトが発生する可能性があるから
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?