Differences between Git merge –squash and –no-commit

As the title says, I am not really clear about the differences between a git merge --squash and a git merge --no-commit.

As far as I understand the help page for git merge, both commands would leave me in an updated working-tree, where it is still possible to edit and then to do a final commit (or multiple commits).

  • How to make gitk show only local branches?
  • Git over samba cannot fetch/add/commit anymore
  • How to add and commit removals made with “rm” instead of “git rm”?
  • How can I checkout a branch while ensuring that none of my current branch's changes are carried over?
  • Can git list the tags that occur between two particular commits?
  • How to git stash pop specific stash in 1.8.3?
  • Could someone clarify the differences of those 2 options? When would I use one instead of the other?

  • IntelliJ error: branch 'origin/HEAD' does not point at a commit, some refs could not be read
  • What is the difference between github and gist?
  • How can I display dates when local updates were made to a git repo?
  • How to disassociate working copy of an Xcode 5 project from SVN server that died
  • Fastlane Appfile in GIT? How to retrieve current apple_id?
  • When cloning git repo under Windows I get “error: unable to create file <file>… (Is a directory)”
  • One Solution collect form web for “Differences between Git merge –squash and –no-commit”

    git merge --no-commit

    This is just like a normal merge but doesn’t create a merge-commit. This commit will be a merge commit: when you look at the history, your commit will appear as a normal merge.

    git merge --squash

    This will merge the changes into your working tree without creating a merge commit. When you commit the merged changes, it will look like a new “normal” commit on your branch: without a merge commit in the history. It’s almost like you did a cherry-pick on all the merged changes.

    Git Baby is a git and github fan, let's start git clone.