File: git-squash.1

package info (click to toggle)
git-extras 7.3.0-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 1,988 kB
  • sloc: sh: 4,235; python: 634; makefile: 146
file content (64 lines) | stat: -rw-r--r-- 1,697 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SQUASH" "1" "October 2020" "" "Git Extras"
.
.SH "NAME"
\fBgit\-squash\fR \- squash N last changes up to a ref\'ed commit
.
.SH "SYNOPSIS"
\fBgit\-squash\fR [<\-\-squash\-msg>] <source\-branch|commit ref> [<commit\-message>]
.
.SH "DESCRIPTION"
Squash the N last changes in the current branch, where N is the range of commits from the given ref up to HEAD\.
.
.SH "OPTIONS"
<source\-branch>
.
.P
Branch to squash on the current branch\.
.
.P
<commit reference> A commit reference (has to be from the current branch) can also be used as the first argument\. A range of commits \fIsha\fR\.\.HEAD will be squashed\.
.
.P
<\-\-squash\-msg>
.
.P
Commit the squash result with the concatenated squashed committed messages\. This option can not be used together with <commit\-message>\.
.
.P
<commit\-message>
.
.P
If commit\-message is given, commit the squashed result, otherwise the squash remains just added to the index and is not committed\.
.
.SH "EXAMPLES"
.
.nf

# squash changes and follow up with separate commit step
$ git squash my\-other\-branch
Updating a2740f5\.\.533b19c
Fast\-forward
Squash commit \-\- not updating HEAD
 my\-changed\-file | 1 +
 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
.
.fi
.
.SH "AUTHOR"
Written by Jesús Espino <\fIjespinog@gmail\.com\fR>
.
.SH "REPORTING BUGS"
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
.
.SH "SEE ALSO"
<\fIhttps://github\.com/tj/git\-extras\fR>