threads / discuss / 58654

Commit amend during a merge conflict

Subject: Commit amend during a merge conflict

## tl;dr

One message between Oct 20, 2022 and Oct 20, 2022.

replies: 0people: 1as markdown or json

Matan Wiesner· Oct 20, 2022, 08:24 UTC · lore
Hi
When I use git to edit a long change of commit there are two scenarios I meet:
1. edit existing commit - in this case I do "git rebase -i", stop in
my commit, them run "git commit --amend" and them run "git rebase
--continue"
2. rebase and solve conflicts - when I rebase (for example on top of
main branch) and meet a conflict : "cannot apply commit A" I need to
solve these conflict, then run "git rebase --continue", it easy to
confuse and run "git commit --amend" and in this scenario, that leads
to commit A and the commit before A to be squashed.
My claim is, that there is no scenario that the user actually wants to
commit (and not run "rebase --continue") when there are merge
conflicts, therefore git should block this option.

As a reference to support my claim, I link 2 stack overflow threads of users that did this mistake https://stackoverflow.com/questions/41439424/i-amended-instead-of-resolving-conflict-in-interactive-rebase-can-i-undo https://stackoverflow.com/questions/11116572/git-commit-during-git-rebase-what-really-happens

WDYT?

← back to recent threads