Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates git-squash.md: fixes help which was unclear and had remnants … #884

Merged
merged 6 commits into from
Oct 14, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions man/git-squash.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git-squash(1) -- Import changes from a branch
git-squash(1) -- squash N last changes up to a ref'ed commit
=============================================

## SYNOPSIS
Expand All @@ -7,8 +7,7 @@ git-squash(1) -- Import changes from a branch

## DESCRIPTION

Produce the working tree and index state as if a real merge happened without
the commit or merge marks.
Squash the N last changes in the current branch, where N is the range of commits from the given ref up to HEAD.

## OPTIONS

Expand All @@ -20,17 +19,18 @@ git-squash(1) -- Import changes from a branch
A commit reference (has to be from the current branch) can also be used as the
first argument. A range of commits <sha>..HEAD will be squashed.

&lt;--squash-msg&gt;
&lt;--squash-messages&gt;

Commit the squash result with the concatenated squashed committed messages.
This option can not be used together with &lt;commit-message&gt;.

&lt;commit-message&gt;

If commit-message is given, commit the squash result.
If commit-message is given, commit the squashed result, otherwise the squash remains just added to the index and is not committed.

## EXAMPLES

# squash changes and follow up with separate commit step
$ git squash my-other-branch
Updating a2740f5..533b19c
Fast-forward
Expand All @@ -39,7 +39,10 @@ git-squash(1) -- Import changes from a branch
1 file changed, 1 insertion(+)
$ git commit -m "New commit without a real merge"

# squash and commit with given message
$ git squash HEAD~3 "Commit message"

# squash and commit and concatenate all messages
$ git squash --squash-msg @~3

## AUTHOR
Expand Down