0
0

More than 1 year has passed since last update.

Gitのrebaseに関して

Posted at

・Gitのrebaseに関して
rebase
=>変更履歴を綺麗に修正(分岐していたコミットを1つにまとめて統合)

●コマンド
git rebase ブランチ名
例)

git rebase master
=>現在作業しているブランチの親コミットをmasterブランチに変更・修正

●リベースの流れ
①リベース
②リベースした親ブランチに移動
③親ブランチをリベースしたブランチとマージ(Fast Foward)
例)featureブランチをmasterブランチにリベースする場合

git switch feature
git rebase master
git switch master
git merge feature

●注意点
GitHubにプッシュしたコミットをリベースしてはいけない。
これを行ってしまうと、ローカルデータとGitHubデータ間の親コミットが異なるものとなってしまい、push出来なくなる。

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