I branched off of master to build a feature for our website, the branch now has maybe 1,000 commits now, and I don't want to merge that into the master. I would like to take the HEAD
of the branch and basically remove all of the other commits.
I tried doing a rebase
but that didn't seem to work, as it still shows the 1k(ish) commits.
git rebase -i dev-dashboard
I would then like to squash ALL commits and make the HEAD
the only commit, then merge that into the master. How can this be done?
master
will have 7 commits, 6 on the "straight line" A-B-C-D-E-M and one on the "branch line" A - (down) F - (up) M (not counting A again, since it's "up"). If you don't squash, you'd have the same 6, but 1000 on the "down" line. (I can't really draw these as a graph in a comment...) Note thatgit log
follows both branches "simultaneously" by default;--first-parent
tells it to ignore the "incoming" branches.