-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-pinch.1
117 lines (117 loc) · 2.85 KB
/
git-pinch.1
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.TH "GIT\-PINCH" "1" "January 27, 2014" "git\-pinch 0.02" "git\-pinch User Manuals"
.SH NAME
.PP
git\-pinch \- enable "retroactive" creation of feature branches
.SH SYNOPSIS
.PP
git pinch [\-\-upstream <upstream>] <commit>...
.SH DESCRIPTION
.PP
git\-pinch is a Git extension to enable "retroactive" creation of
feature branches.
.SH OPTIONS
.TP
.B \-\-no\-edit
Do not edit message before committing.
.RS
.RE
.TP
.B \-u, \-\-upstream
Base off given commit instead of upstream.
If is not specified, the current branch\[aq]s upstream will be used.
If you are currently not on any branch or if the current branch does not
have a configured upstream the command will abort.
.RS
.RE
.TP
.B \-p, \-\-preserve\-merges
Try to recreate merges instead of ignoring them.
.RS
.RE
.SH EXAMPLES
.PP
A common use case might be that you start making a single "trivial"
change in \f[C]master\f[] but end up making several commits.
If you decide you should have used a feature branch then you would have
to:
.IP
.nf
\f[C]
$\ git\ branch\ feature
$\ git\ reset\ \-\-hard\ \@{u}
$\ git\ merge\ \-\-no\-ff\ feature
$\ git\ branch\ \-d\ feature
\f[]
.fi
.PP
or instead:
.IP
.nf
\f[C]
$\ git\ pinch\ HEAD
\f[]
.fi
.PP
More generally, when developing incremental steps (refactoring, etc.)
can sometimes lead to sets of changes that could themselves be described
as (sub)features.
\f[C]git\-pinch\f[] automates the process of taking a linear set of
changes and grouping sets of them into merged feature branches.
.PP
For example, suppose you commit four changes (A, B, C, D) and then
realize A and B were really implementing some (sub)feature and C and D
were another.
You could run,
.IP
.nf
\f[C]
$\ git\ pinch\ B\ D
\f[]
.fi
.PP
the result would be:
.IP
.nf
\f[C]
*\ \ \ Merge\ in\ \[aq]second\ feature\[aq]\ work
|\\
|\ *\ D
|\ *\ C
|/
*\ \ \ Merge\ in\ \[aq]first\ feature\[aq]\ work
|\\
|\ *\ B
|\ *\ A
|/
*\ \@{u}
\f[]
.fi
.SH SEE ALSO
.PP
\f[C]git\-rebase\f[] (1).
.SH BUGS
.PP
No known bugs.
.SH COPYRIGHT
.PP
Copyright (c) 2013, Nathaniel Nutter
.PP
This is free documentation; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
.PP
The GNU General Public License\[aq]s references to "object code" and
"executables" are to be interpreted as the output of any document
formatting or typesetting system, including intermediate and printed
output.
.PP
This manual is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this manual; if not, see <http://www.gnu.org/licenses/>.
.SH AUTHORS
Nathaniel Nutter <git\-pinch\@nnutter.com>.