Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 294 lines (293 sloc) 5.755 kB
001efd6 @rtomayko `make install' installs git-sh(1) manpage
authored
1 .\" generated with Ronn/v0.4.1
2 .\" http://github.com/rtomayko/ronn/
3 .
4 .TH "GIT\-SH" "1" "March 2010" "Ryan Tomayko" ""
5 .
6 .SH "NAME"
7 \fBgit\-sh\fR \-\- a git shell
8 .
9 .SH "SYNOPSIS"
10 \fBgit\-sh\fR
11 .
12 .SH "DESCRIPTION"
13 \fBgit\-sh\fR starts an interactive \fBbash(1)\fR session modified for git\-heavy
14 workflows. Typical usage is to change into the directory of a git work tree or
15 bare repository and run the \fBgit\-sh\fR command to start an interactive shell
16 session.
17 .
18 .P
19 Top\-level command aliases are created for all core \fBgit(1)\fR subcommands, git\-sh
20 builtin aliases (see \fIBUILTIN ALIASES\fR), and git command aliases defined in \fB~/.gitconfig\fR.
21 .
22 .SH "BUILTIN ALIASES"
23 \fBgit\-sh\fR loads a set of standard aliases in addition to all core git commands.
24 The builtin aliases are overridden by aliases defined in the user or system
25 gitconfig files.
26 .
27 .TP
28 \fBa\fR
29 git add
30 .
31 .TP
32 \fBb\fR
33 git branch
34 .
35 .TP
36 \fBc\fR
37 git checkout
38 .
39 .TP
40 \fBd\fR
41 git diff
42 .
43 .TP
44 \fBf\fR
45 git fetch \-\-prune
46 .
47 .TP
48 \fBk\fR
49 git cherry\-pick
50 .
51 .TP
52 \fBl\fR
53 git log \-\-pretty=oneline \-\-abbrev\-commit
54 .
55 .TP
56 \fBn\fR
57 git commit \-\-verbose \-\-amend
58 .
59 .TP
60 \fBr\fR
61 git remote
62 .
63 .TP
64 \fBs\fR
65 git commit \-\-dry\-run \-\-short
66 .
67 .TP
68 \fBt\fR
69 git diff \-\-cached
70 .
71 .SS "The Staging Area"
72 .
73 .TP
74 \fBa\fR
75 git add
76 .
77 .TP
78 \fBaa\fR
79 git add \-\-update (mnemonic: "add all")
80 .
81 .TP
82 \fBstage\fR
83 git add
84 .
85 .TP
86 \fBap\fR
87 git add \-\-patch
88 .
89 .TP
90 \fBp\fR
91 git diff \-\-cached (mnemonic: "patch")
92 .
93 .TP
94 \fBps\fR
95 git diff \-\-cached \-\-stat (mnemonic: "patch stat")
96 .
97 .TP
98 \fBunstage\fR
99 git reset HEAD
100 .
101 .SS "Commits and Commit History"
102 .
103 .TP
104 \fBci\fR
105 git commit \-\-verbose
106 .
107 .TP
108 \fBca\fR
109 git commit \-\-verbose \-\-all
110 .
111 .TP
112 \fBamend\fR
113 git commit \-\-verbose \-\-amend
114 .
115 .TP
116 \fBn\fR
117 git commit \-\-verbose \-\-amend
118 .
119 .TP
120 \fBk\fR
121 git cherry\-pick
122 .
123 .TP
124 \fBre\fR
125 git rebase \-\-interactive
126 .
127 .TP
128 \fBpop\fR
129 git reset \-\-soft HEAD^
130 .
131 .TP
132 \fBpeek\fR
133 git log \-p \-\-max\-count=1
134 .
135 .SS "Fetching and Pulling"
136 .
137 .TP
138 \fBf\fR
139 git fetch
140 .
141 .TP
142 \fBpm\fR
143 git pull (mnemonic: "pull merge")
144 .
145 .TP
146 \fBpr\fR
147 git pull \-\-rebase (mnemonic: "pull rebase")
148 .
149 .SS "Miscellaneous Commands"
150 .
151 .TP
152 \fBd\fR
153 git diff
154 .
155 .TP
156 \fBds\fR
157 git diff \-\-stat (mnemonic: "diff stat")
158 .
159 .TP
160 \fBhard\fR
161 git reset \-\-hard
162 .
163 .TP
164 \fBsoft\fR
165 git reset \-\-soft
166 .
c61473f @rtomayko builtin alias scrap = git checkout HEAD ...
authored
167 .TP
168 \fBscrap\fR
169 git checkout HEAD
170 .
001efd6 @rtomayko `make install' installs git-sh(1) manpage
authored
171 .SH "CUSTOM ALIASES"
172 Anything defined in the \fB[alias]\fR section of the repository, user, or system git
173 config files are also available as top\-level shell commands. Assuming a \fB~/.gitconfig\fR that looked like this:
174 .
175 .IP "" 4
176 .
177 .nf
178 [alias]
179 ci = commit \-\-verbose
180 ca = commit \-a
181 d = diff
182 s = status
183 thanks = !git\-thanks
184 .
185 .fi
186 .
187 .IP "" 0
188 .
189 .P
190 ... you might then have the following shell session:
191 .
192 .IP "" 4
193 .
194 .nf
195 master!something> echo "stuff" >somefile
196 master!something*> s
197 M somefile
198 master!something*> d
199 diff \-\-git a/somefile b/somefile
200 \-\- a/somefile
201 ++ b/somefile
202 @@ \-0,0 +1 @@
203 + stuff
204 master!something*> ca \-m "add stuff"
205 master!something> thanks HEAD
206 .
207 .fi
208 .
209 .IP "" 0
210 .
211 .SS "PROMPT"
212 The default prompt shows the current branch, a bang (\fB!\fR), and then the relative
213 path to the current working directory from the root of the work tree. If the
214 work tree includes modified files that have not yet been staged, a dirty status
215 indicator (\fB*\fR) is also displayed.
216 .
217 .P
218 The git\-sh prompt includes ANSI colors when the git \fBcolor.ui\fR option is set and
219 enabled. To enable git\-sh's prompt colors explicitly, set the \fBcolor.sh\fR config
220 value to \fBauto\fR:
221 .
222 .IP "" 4
223 .
224 .nf
225 $ git config \-\-global color.sh auto
226 .
227 .fi
228 .
229 .IP "" 0
230 .
231 .P
232 Customize prompt colors by setting the \fBcolor.sh.branch\fR, \fBcolor.sh.workdir\fR,
233 and \fBcolor.sh.dirty\fR git config values:
234 .
235 .IP "" 4
236 .
237 .nf
238 $ git config \-\-global color.sh.branch 'yellow reverse'
239 $ git config \-\-global color.sh.workdir 'blue bold'
240 $ git config \-\-global color.sh.dirty 'red'
27c0a85 add color.sh.dirty-stash and color.sh.repo-state to docs
Slipp Douglas authored
241 $ git config \-\-global color.sh.dirty-stash 'red'
242 $ git config \-\-global color.sh.repo-state 'red'
001efd6 @rtomayko `make install' installs git-sh(1) manpage
authored
243 .
244 .fi
245 .
246 .IP "" 0
247 .
248 .P
249 See \fIcolors in git\fR for information.
250 .
251 .SH "COMPLETION"
252 Bash completion support is automatically enabled for all git built\-in commands
253 and also for aliases defined in the user \fB~/.gitconfig\fR file. The auto\-completion
254 logic is smart enough to know an alias \fBd\fR that expands to \fBgit\-diff\fR should use
255 the same completion configuration as the \fBgit\-diff\fR command.
256 .
257 .P
258 The completion code is a slightly modified version of the git bash completion
259 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
260 separately.
261 .
262 .SH "CUSTOMIZING"
263 Most \fBgit\-sh\fR behavior can be configured by editing the user or system gitconfig
264 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.
265 .
266 .P
267 The \fB/etc/gitshrc\fR and \fB~/.gitshrc\fR files are sourced (in that order)
268 immediately before the shell becomes interactive.
269 .
270 .P
271 The \fB~/.bashrc\fR file is sourced before either \fB/etc/gitshrc\fR or \fB~/.gitshrc\fR.
272 Any bash customizations defined there and not explicitly overridden by \fBgit\-sh\fR
273 are also available.
274 .
275 .SH "ENVIRONMENT"
276 .
277 .TP
278 \fBPS1\fR
279 Set to the dynamic git\-sh prompt. This can be customized in the \fB~/.gitshrc\fR
280 or \fB/etc/gitshrc\fR files.
281 .
282 .TP
283 \fBGIT_DIR\fR
284 Explicitly set the path to the git repository instead of assuming the
285 nearest \fB.git\fR path.
286 .
287 .TP
288 \fBGIT_WORK_TREE\fR
289 Explicitly set the path to the root of the work tree instead of assuming
290 the nearest parent directory with a \fB.git\fR repository.
291 .
292 .SH "SEE ALSO"
a6eba88 @rtomayko link to project page from manpage
authored
293 bash(1), git(1), git\-config(1),\fIhttp://github.com/rtomayko/git\-sh\fR
Something went wrong with that request. Please try again.