It is a series of auto-commits that took place at a certain interval. Is there any command or algorithm to simply delete commit A without needing to adjust the following commits ?
In fact, B already contains all of A’s changes, and subsequent commits to other files are not affected by its loss.
- Each commit contains changes to only one file.
- Commits marked with a character contain changes in one file,
- commits marked with numbers indicate changes in another file.
For comparison, I have first given an example with a normal commit –amend.
master
↓
1 --- 2 --- A
$ git commit --amend → B
master
↓
1 --- 2 --- A B
/
_______/
master
↓
1 --- A --- 2
$ ???
master
↓
1 --- A 2 --- B
/
_______/
Using git rebase creates an unnecessary merge conflict. Interesting non-interactive options.