18
loading...
This website collects cookies to deliver better user experience
git commit --amend -m “new commit message”
git rebase -i HEAD~5
.git rebase -i HEAD~5
I get a list of the last five commits I made in this particular repository.pick
with reword
indicates that you want to edit the commit message of that specific commit.git rebase -i HEAD~5
this is the result.pick
command with the drop
command on the commit you want to remove.git rebase -i HEAD~5
you'll run git rebase -i HEAD~4
as you have remove one commit.squash
command. The squash
command allows us to combine two or more commits into one commit and write a new commit message to describe the new commit.pick
command with the squash
command on the commit you want to combine into the previous one.fixup
command works like the squash
command, the only difference is that the fixup
command will discard the commit message of the latest commit and remain with the commit message of the commit message of the commit they'll be merged intogit push --force origin name-of-the-branch-you-are-working-on