My Problem
I have been working on a git repo. Before publishing my changes, I'd like to remove some commits - a023b43
, 315424b
and 7b51754
- as they do not reflect any meaningful changes. The only important points in time are the first (70f72ca
) and last (6937ddd
) commits.
What Have I Tried
git rebase -i 4c802c1
I chose:
pick 70f72ca Remove repetitions from Makefile
d a023b43 Separate target for image conversion
d 315424b Remove image conversion (#1)
d 7b51754 Fix Makefile
pick 6937ddd CV 2019.01
The final goal is to have a git log that looks like:
6937ddd CV 2019.01
4c802c1 Initial commit
What Did not Work
Auto-merging src/Adam_Matan.tex
CONFLICT (content): Merge conflict in src/Adam_Matan.tex
error: could not apply 6937ddd... CV 2019.01
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 6937ddd... CV 2019.01
As I understand it, the two commits are just snapshots of my working directory. I want to have two snapshots - the original commit and the CV 2019.01
one. I don't want to merge or combine them in any way. Why do I get a merge conflict message?
My Question
How can I delete all intermediate commits from a branch, and leave only the first and last commits?
Update
Squashing creates merge conflicts as well:
git rebase -i 4c802c1
Auto-merging Makefile
CONFLICT (content): Merge conflict in Makefile
error: could not apply 315424b... Remove image conversion (#1)