・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出来なくなる。