This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
git-sh.1.roff
293 lines (293 loc) · 5.62 KB
/
git-sh.1.roff
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
.\" generated with Ronn/v0.4.1
.\" http://github.com/rtomayko/ronn/
.
.TH "GIT\-SH" "1" "March 2010" "Ryan Tomayko" ""
.
.SH "NAME"
\fBgit\-sh\fR \-\- a git shell
.
.SH "SYNOPSIS"
\fBgit\-sh\fR
.
.SH "DESCRIPTION"
\fBgit\-sh\fR starts an interactive \fBbash(1)\fR session modified for git\-heavy
workflows. Typical usage is to change into the directory of a git work tree or
bare repository and run the \fBgit\-sh\fR command to start an interactive shell
session.
.
.P
Top\-level command aliases are created for all core \fBgit(1)\fR subcommands, git\-sh
builtin aliases (see \fIBUILTIN ALIASES\fR), and git command aliases defined in \fB~/.gitconfig\fR.
.
.SH "BUILTIN ALIASES"
\fBgit\-sh\fR loads a set of standard aliases in addition to all core git commands.
The builtin aliases are overridden by aliases defined in the user or system
gitconfig files.
.
.TP
\fBa\fR
git add
.
.TP
\fBb\fR
git branch
.
.TP
\fBc\fR
git checkout
.
.TP
\fBd\fR
git diff
.
.TP
\fBf\fR
git fetch \-\-prune
.
.TP
\fBk\fR
git cherry\-pick
.
.TP
\fBl\fR
git log \-\-pretty=oneline \-\-abbrev\-commit
.
.TP
\fBn\fR
git commit \-\-verbose \-\-amend
.
.TP
\fBr\fR
git remote
.
.TP
\fBs\fR
git commit \-\-dry\-run \-\-short
.
.TP
\fBt\fR
git diff \-\-cached
.
.SS "The Staging Area"
.
.TP
\fBa\fR
git add
.
.TP
\fBaa\fR
git add \-\-update (mnemonic: "add all")
.
.TP
\fBstage\fR
git add
.
.TP
\fBap\fR
git add \-\-patch
.
.TP
\fBp\fR
git diff \-\-cached (mnemonic: "patch")
.
.TP
\fBps\fR
git diff \-\-cached \-\-stat (mnemonic: "patch stat")
.
.TP
\fBunstage\fR
git reset HEAD
.
.SS "Commits and Commit History"
.
.TP
\fBci\fR
git commit \-\-verbose
.
.TP
\fBca\fR
git commit \-\-verbose \-\-all
.
.TP
\fBamend\fR
git commit \-\-verbose \-\-amend
.
.TP
\fBn\fR
git commit \-\-verbose \-\-amend
.
.TP
\fBk\fR
git cherry\-pick
.
.TP
\fBre\fR
git rebase \-\-interactive
.
.TP
\fBpop\fR
git reset \-\-soft HEAD^
.
.TP
\fBpeek\fR
git log \-p \-\-max\-count=1
.
.SS "Fetching and Pulling"
.
.TP
\fBf\fR
git fetch
.
.TP
\fBpm\fR
git pull (mnemonic: "pull merge")
.
.TP
\fBpr\fR
git pull \-\-rebase (mnemonic: "pull rebase")
.
.SS "Miscellaneous Commands"
.
.TP
\fBd\fR
git diff
.
.TP
\fBds\fR
git diff \-\-stat (mnemonic: "diff stat")
.
.TP
\fBhard\fR
git reset \-\-hard
.
.TP
\fBsoft\fR
git reset \-\-soft
.
.TP
\fBscrap\fR
git checkout HEAD
.
.SH "CUSTOM ALIASES"
Anything defined in the \fB[alias]\fR section of the repository, user, or system git
config files are also available as top\-level shell commands. Assuming a \fB~/.gitconfig\fR that looked like this:
.
.IP "" 4
.
.nf
[alias]
ci = commit \-\-verbose
ca = commit \-a
d = diff
s = status
thanks = !git\-thanks
.
.fi
.
.IP "" 0
.
.P
... you might then have the following shell session:
.
.IP "" 4
.
.nf
master!something> echo "stuff" >somefile
master!something*> s
M somefile
master!something*> d
diff \-\-git a/somefile b/somefile
\-\- a/somefile
++ b/somefile
@@ \-0,0 +1 @@
+ stuff
master!something*> ca \-m "add stuff"
master!something> thanks HEAD
.
.fi
.
.IP "" 0
.
.SS "PROMPT"
The default prompt shows the current branch, a bang (\fB!\fR), and then the relative
path to the current working directory from the root of the work tree. If the
work tree includes modified files that have not yet been staged, a dirty status
indicator (\fB*\fR) is also displayed.
.
.P
The git\-sh prompt includes ANSI colors when the git \fBcolor.ui\fR option is set and
enabled. To enable git\-sh's prompt colors explicitly, set the \fBcolor.sh\fR config
value to \fBauto\fR:
.
.IP "" 4
.
.nf
$ git config \-\-global color.sh auto
.
.fi
.
.IP "" 0
.
.P
Customize prompt colors by setting the \fBcolor.sh.branch\fR, \fBcolor.sh.workdir\fR,
and \fBcolor.sh.dirty\fR git config values:
.
.IP "" 4
.
.nf
$ git config \-\-global color.sh.branch 'yellow reverse'
$ git config \-\-global color.sh.workdir 'blue bold'
$ git config \-\-global color.sh.dirty 'red'
$ git config \-\-global color.sh.dirty-stash 'red'
$ git config \-\-global color.sh.repo-state 'red'
.
.fi
.
.IP "" 0
.
.P
See \fIcolors in git\fR for information.
.
.SH "COMPLETION"
Bash completion support is automatically enabled for all git built\-in commands
and also for aliases defined in the user \fB~/.gitconfig\fR file. The auto\-completion
logic is smart enough to know an alias \fBd\fR that expands to \fBgit\-diff\fR should use
the same completion configuration as the \fBgit\-diff\fR command.
.
.P
The completion code is a slightly modified version of the git bash completion
script shipped with the core git distribution. The script is built into the\fBgit\-sh\fR executable at compile time and need not be obtained or installed
separately.
.
.SH "CUSTOMIZING"
Most \fBgit\-sh\fR behavior can be configured by editing the user or system gitconfig
files (\fB~/.gitconfig\fR and \fB/etc/gitconfig\fR) either by hand or using \fBgit\-config(1)\fR. The \fB[alias]\fR section is used to create basic command aliases.
.
.P
The \fB/etc/gitshrc\fR and \fB~/.gitshrc\fR files are sourced (in that order)
immediately before the shell becomes interactive.
.
.P
The \fB~/.bashrc\fR file is sourced before either \fB/etc/gitshrc\fR or \fB~/.gitshrc\fR.
Any bash customizations defined there and not explicitly overridden by \fBgit\-sh\fR
are also available.
.
.SH "ENVIRONMENT"
.
.TP
\fBPS1\fR
Set to the dynamic git\-sh prompt. This can be customized in the \fB~/.gitshrc\fR
or \fB/etc/gitshrc\fR files.
.
.TP
\fBGIT_DIR\fR
Explicitly set the path to the git repository instead of assuming the
nearest \fB.git\fR path.
.
.TP
\fBGIT_WORK_TREE\fR
Explicitly set the path to the root of the work tree instead of assuming
the nearest parent directory with a \fB.git\fR repository.
.
.SH "SEE ALSO"
bash(1), git(1), git\-config(1),\fIhttp://github.com/rtomayko/git\-sh\fR