rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.86k stars 535 forks source link

Merging and/or amending commits in-place #364

Open knakamura13 opened 4 years ago

knakamura13 commented 4 years ago

This may already be possible, but it is not in the documentation anywhere.

How can I merge two commits into one, such that the older commit no longer exists? It's fine if the hash value has to change.

Example of my git history:

Kyle Nakamura: 8814c3a on Thu Jan 16 12:57:59 2020 -0800         Add autofocus to textfield
Kyle Nakamura: 970df0b on Thu Jan 16 12:04:23 2020 -0800         Add another comment
Kyle Nakamura: 27b4719 on Thu Jan 16 12:03:46 2020 -0800         Add a comment
Kyle Nakamura: 4bb1cfd on Mon Jan 13 17:07:05 2020 -0800         Initial commit 

An example of what I want to change it to:

Kyle Nakamura: 8814c3a on Thu Jan 16 12:57:59 2020 -0800         Add autofocus to textfield
Kyle Nakamura: 27b4719 on Thu Jan 16 12:03:46 2020 -0800         Add two comments
Kyle Nakamura: 4bb1cfd on Mon Jan 13 17:07:05 2020 -0800         Initial commit

Thanks!