Is it possible to use git rebase
to remove all of the history from a specific commit to the HEAD revision?
With git -i rebase
, you have to count all of the commits in the git log
and manually get squash of all of them except one commit before pushing the changes.
Is there a one-liner to do the following:
git rebase -i HEAD~4
for 4 commits- Within the text editor, squash everything and keep one pick (I think you have to pick at least one commit)
git fetch origin
to update the referencesgit rebase origin/master
to rebase the branch onto the mastergit checkout master
to switch to the master branchgit merge branch_name
to merge the branch onto the master
Is it possible to do this with less steps or other flags?