Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • Thanks for the full explanation. I'm guessing you use -u in git add -u as it's more careful than -a, and since you would not expect adding/removing files when fixing a rebase? Commented Jul 21, 2018 at 15:41
  • Yes, generally -u tends to be the right thing here. Any options or parameters that achieve the desired index updates is fine, of course. Commented Jul 21, 2018 at 15:49
  • I just tried it out, but the amend did not work. What I did was a git rebase -i, setting all to "edit", and when it stopped after the first merge, I did manual changes. Then, I did git commit --amend, which modified the tip of the master branch (or better, I think it created a new commit there). Must I somehow commit before the amend? Commented Jul 24, 2018 at 22:02
  • Once you select edit and let rebase run and then halt, git status should show that you are not on any branch: you should have HEAD detached at ... or HEAD detached from ... (the exact string depends on your Git version). The --amend should therefore update the detached HEAD, after which git rebase --continue should continue cherry-picking atop the latest commit. Commented Jul 24, 2018 at 22:05
  • It does not directly say "detached", but "rebase in progress". I made screenshots of gitk. Commented Jul 24, 2018 at 22:29