この記事が役立つ状況
- 作業ブランチは、pushしていない
- 作業ブランチで
git rebase developをしたらコンフリクトした
rebaseの手順
作業ブランチは、(work)であるものとする。
- 作業ブランチに未コミットの修正がない状態にする
git add -A-
git commit -m "comment"- コミットする粒度ではない場合
git stash
- コミットする粒度ではない場合
- develop(rebase先)を最新にする
git checkout developgit pull
- rebaseする
git checkout workgit rebase develop- ここで、コンフリクトしてしまい、警告が出たものとする
- コンフリクトしたファイルを確認する
(警告メッセージを読めば書いてあるが、gitbashだと色が付くのでこちらの方がわかりやすい)git status-
both modified: xxx.xxxを探す
- コンフリクトを解消する
- xxx.xxx を修正する
git add xxx.xxx
- rebaseを完了させる
git rebase --continue- (stashしていた場合のみ)
git stash pop