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~4for 4 commits- Within the text editor, squash everything and keep one pick (I think you have to pick at least one commit)
git fetch originto update the referencesgit rebase origin/masterto rebase the branch onto the mastergit checkout masterto switch to the master branchgit merge branch_nameto merge the branch onto the master
Is it possible to do this with less steps or other flags?
Instead of
git rebase -iyou can rungit rebase --soft <commit-id>to moveHEADto<commit-id>without changing the index or the working tree thengit committo create a new commit that contains all the changes since<commit-id>.