
# However, if you remove everything, the rebase will be aborted. # If you remove a line here THAT COMMIT WILL BE LOST. # These lines can be re-ordered they are executed from top to bottom. # x, exec = run command (the rest of the line) using shell # f, fixup = like "squash", but discard this commit's log message # s, squash = use commit, but meld into previous commit # e, edit = use commit, but stop for amending # r, reword = use commit, but edit the commit message Pick 30374054 Add Jupyter Notebook to Data Science Tools Pick 8490f5fc Minor formatting and Punctuation changes

That will open an editor with something like the following: pick 3233cb21 Prototype for Notebook page So what we do is start an interactive rebase session from the current HEAD (commit 30374054) to commit 3233cb21, with the intention to combine the 3 latest commits into one: $ git rebase -i HEAD~3 So let’s assume you have following commit log in the branch you’d like to merge as part of pull request: $ git log -pretty=oneline -abbrev-commitģ0374054 Add Jupyter Notebook stub to Data Science ToolsĨ490f5fc Minor formatting and Punctuation changesĬlearly we would prefer to have only one commit here, since there is no benefit in knowing what we started on writing and which typos we fixed there later. Most of the time there is no use in having all these commits in the final public version of your code, so it’s more beneficial to have all of them compacted into one, single and final version. That might be just some typos or steps to final solution. Quite often when you develop some new feature you end up with several intermittent commits in your history - you develop incrementally after all. To achieve this, a developer needs to use interactive mode of Git Rebase command.

To squash pull request means commonly to compact all the commits in this request into one (rarely to other number) to make it more concise, readable and not to pollute main branch’s history. The fun part is that there is no such command like git squash (unless you create an alias to it).

One of the things that developers hear quite often regarding their pull requests is something like “That looks good to me, please squash and merge”.
