• 追加された行はこの色です。
  • 削除された行はこの色です。
#author("2020-10-14T00:34:13+09:00","default:ryuichi","ryuichi")
#author("2020-10-14T00:36:47+09:00","default:ryuichi","ryuichi")
* 最初のコミットからgit rebaseする [#k5387cc5]

** 前提 [#h40fd22f]

 git log --oneline
 
 0163e89 (HEAD -> master) #3
 11142ad #2
 6fc1385 #1

- 現在3つのコミットがあるとする

** エラー fatal: invalid upstream 'HEAD~3' [#dfe6160c]

 git rebase -i HEAD~3
 
 fatal: invalid upstream 'HEAD~3'

- '''HEAD~3'''とするとエラーになる
- git rebaseは'''HEAD~3'''(=最初のコミット)の親コミットを参照しようとするので、エラーになる
- このような場合、以下のようにする

** --root オプション [#o5bd7543]

 git rebase -i --root

- --rootオプションを使う

** 参考 [#le89566f]

https://stackoverflow.com/questions/22992543/how-do-i-git-rebase-the-first-commit/23000315


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS