Child pages
  • squashing commit

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
git push --force


8 개의 commit squash

Image Added


  • You got 6 commits here. "Merging" them into one single commit is known as "squashing commits".

    Here's one way to do it:

    1. In your git repo, do git rebase -i HEAD~6 (because we would like to rebase 6 commits starting at the latest one, which is the current HEAD)
    2. It will open an editor. Each line starting with pick describes a commit. On the first line, you will see the first commit of this PR, this is the commit we would like to keep, so we will not modify this line. For all the following lines, replace pick with fixup.
    3. Close the editor. Git will start rewriting history.
    4. git push --force