1VCSH(1) VCSH(1)
2
3
4
6 vcsh - Version Control System for $HOME - multiple Git repositories in
7 $HOME
8
10 vcsh [options] command
11
12 vcsh clone [-b branch] url [repo]
13
14 vcsh delete repo
15
16 vcsh enter repo
17
18 vcsh foreach [-g] git command
19
20 vcsh help
21
22 vcsh init repo
23
24 vcsh list
25
26 vcsh list-tracked [repo]
27
28 vcsh list-untracked [-a] [-r] [repo]
29
30 vcsh pull
31
32 vcsh push
33
34 vcsh rename repo newname
35
36 vcsh run repo shell command
37
38 vcsh status [repo]
39
40 vcsh upgrade repo
41
42 vcsh version
43
44 vcsh which substring
45
46 vcsh write-gitignore repo
47
48 vcsh repo git command
49
50 vcsh repo
51
53 vcsh allows you to have several git(1) repositories, all maintaining
54 their working trees in $HOME without clobbering each other. That, in
55 turn, means you can have one repository per config set (zsh, vim, ssh,
56 etc), picking and choosing which configs you want to use on which
57 machine.
58
59 vcsh is using a technique called fake bare Git repositories, keeping
60 $GIT_DIR in a different directory from $GIT_WORK_TREE which is pointed
61 to $HOME.
62
63 The use of symlinks is not needed in this setup, making for a cleaner
64 setup.
65
66 vcsh was designed with mr(1) in mind so you might want to install it
67 alongside vcsh. That being said, you can easily use vcsh without mr if
68 you prefer.
69
70 A sample configuration for vcsh and mr can be found at
71 https://github.com/RichiH/vcsh_mr_template and used with vcsh clone
72 https://github.com/RichiH/vcsh_mr_template mr.
73
74 Please note that you can always use a path instead of a name for repo.
75 This is needed to support mr and other scripts properly and of no con‐
76 cern to an interactive user.
77
79 -c Source file prior to other configuration files
80
81 -d Enable debug mode
82
83 -v Enable verbose mode
84
86 clone Clone an existing repository.
87
88 If you need to clone a bundle of repositories, look into the
89 post-clone-retired hook.
90
91 You can also use a single git repository with several branches.
92 Use the -b option to specify a branch at clone time, the default
93 is master.
94
95 commit Commit in all repositories
96
97 delete Delete an existing repository.
98
99 enter Enter repository; spawn new $SHELL.
100
101 foreach
102 Execute git command for every vcsh repository.
103
104 -g: Execute in general context.
105
106 help Display help.
107
108 init Initialize an empty repository.
109
110 list List all local vcsh repositories.
111
112 list-tracked
113 List all files tracked by vcsh.
114
115 If you want to list files tracked by a specific repository, sim‐
116 ply append the repository´s name last.
117
118 list-tracked-by
119 List files tracked by a repository.
120
121 This is a legacy command; you should use list-tracked <repo>
122 instead.
123
124 list-untracked
125 List all files NOT tracked by vcsh.
126
127 -a: Show all files. By default, the git ls-files --exclude-stan‐
128 dard is called.
129
130 -r: Recursive mode. By default, the file list is shallow and
131 stops at directory levels where possible.
132
133 $repo: List files not tracked by this specific repository.
134
135 pull Pull from all vcsh remotes.
136
137 push Push to all vcsh remotes.
138
139 rename Rename a repository.
140
141 run Run command with $GIT_DIR and $GIT_WORK_TREE set. Allows you to
142 run any and all commands without any restrictions. Use with
143 care.
144
145 Please note that there is a somewhat magic feature for run.
146 Instead of repo it accepts path, as well. Anything that has a
147 slash in it will be assumed to be a path. vcsh run will then
148 operate on this directory instead of the one normally generated
149 from the repository´s name. This is needed to support mr and
150 other scripts properly and of no concern to an interactive user.
151
152 status Show statuses of all/one vcsh repositories.
153
154 upgrade
155 Upgrade repository to currently recommended settings.
156
157 version
158 Print version information.
159
160 which substring
161 Find substring in name of any tracked file.
162
163 write-gitignore
164 Write .gitignore.d/repo via git ls-files.
165
166 repo gitcommand
167 Shortcut to run vcsh on a repo. Will prepend git to command.
168
169 repo Shortcut to run vcsh enter <repo>.
170
172 As noted earlier, vcsh will set $GIT_DIR and $GIT_WORK_TREE to the
173 appropriate values for fake bare Git repositories.
174
176 There are several ways to turn the various knobs on vcsh. In order of
177 ascending precedence, they are:
178
179 · VARIABLE=foo vcsh
180
181 · </etc/vcsh/config>
182
183 · <$XDG_CONFIG_HOME/vcsh/config>
184
185 · vcsh -c <file>
186
187
188
189 Please note that those files are sourced. Any and all commands will be
190 executed in the context of your shell.
191
192 Interesting knobs you can turn:
193
194 $VCSH_GITATTRIBUTES
195 Can be none, or any other value.
196
197 none will not maintain Git attributes in a special location.
198
199 If set to any other value, repo-specific gitattributes files
200 will be maintained.
201
202 Defaults to none.
203
204 $VCSH_GITIGNORE
205 Can be exact, none, or recursive.
206
207 exact will seed the repo-specific ignore file with all file and
208 directory names which git ls-files returns.
209
210 none will not write any ignore file.
211
212 recursive will descend through all directories recursively addi‐
213 tionally to the above.
214
215 Defaults to exact.
216
217 $VCSH_VCSH_WORKTREE
218 Can be absolute, or relative.
219
220 absolute will set an absolute path; defaulting to $HOME.
221
222 relative will set a path relative to $GIT_DIR.
223
224 Defaults to absolute.
225
226 Less interesting knobs you could turn:
227
228 $VCSH_DEBUG
229 Enter debug mode.
230
231 $XDG_CONFIG_HOME
232 As specified in the ´XDG Base Directory Specification´, see
233 http://standards.freedesktop.org/basedir-spec/basedir-spec-lat‐
234 est.html
235
236 Defaults to <$HOME/.config>.
237
238 $VCSH_REPO_D
239 The directory where repositories are read from and stored.
240
241 Defaults to <$XDG_CONFIG_HOME/vcsh/repo.d>.
242
243 $VCSH_HOOK_D
244 The directory where hooks are read from.
245
246 Defaults to <$XDG_CONFIG_HOME/vcsh/hooks-enabled>.
247
248 $VCSH_BASE
249 The directory where repositories are checked out to.
250
251 Defaults to $HOME.
252
254 vcsh provides a hook system. Hook scripts must be executable and should
255 be placed in <$XDG_CONFIG_HOME/vcsh/hooks-available>. From there, they
256 can be soft-linked into <$XDG_CONFIG_HOME/vcsh/hooks-enabled>; vcsh
257 will only execute hooks that are in this directory.
258
259 Hooks follow a simple format. pre-run will be run before anything is
260 run. If you want to have more than one script for a certain hook, just
261 append any kind of string to order them. A system of pre-run,
262 <pre-run.10>, <pre-run.20> etc is suggested; other options would be
263 pre-run-10 or <pre-run.sh>. A dot after the hook name is optional.
264
265 If you want to create hooks for a specific vcsh repository, simply
266 prepend the repository´s name, followed by a dot, i.e. <zsh.pre-run>.
267 Otherwise, the same rules as above apply. The dot between the reposi‐
268 tory´s name and the hook is mandatory, though.
269
270 Available hooks are pre-clone, post-clone, post-clone-retired, pre-com‐
271 mand, post-command, pre-enter, post-enter, pre-init, post-init,
272 pre-pull, post-pull, pre-push, post-push, pre-run, post-run,
273 pre-upgrade, and post-upgrade. If you need more, vcsh is trivial to
274 patch, but please let upstream know so we can ship them by default.
275
277 vcsh also provides an overlay system. Similar to hooks, the recommended
278 locations are <$XDG_CONFIG_HOME/vcsh/overlays-available> and <$XDG_CON‐
279 FIG_HOME/vcsh/overlays-enabled>.
280
281 Overlays follow the same rules as hooks and you are free to overwrite
282 any and all functions. Same as hooks, you can use global or reposi‐
283 tory-specific overlays by using either <$VCSH_OVERLAY_D/$VCSH_COMMAND>
284 or <$VCSH_OVERLAY_D/$VCSH_REPO_NAME.$VCSH_COMMAND>.
285
286 Please note that nothing stops you from, e.g. overwriting status() in
287 <$VCSH_OVERLAY_D/commit>. As the overlays will be sourced and you are
288 replacing arbitrary functions, any and all features may stop working,
289 or you may even lose data.
290
291 You have been warned.
292
294 Manpages are often short and sometimes useless to glean best practices
295 from. While the author tried to avoid this in this case, manpages can
296 not cover detailed howtos.
297
298 This software also comes with a file called <README.md>. It contains
299 various approaches to setting up and using vcsh. You can view the file
300 it as plain text or render it into various other formats via Markdown.
301
302 On Debian-based systems, this file can be found in
303 </usr/share/doc/vcsh>.
304
306 vcsh allows you to execute arbitrary commands via vcsh run. For exam‐
307 ple, adding a sudo(8) rule for vcsh would be pretty stupid.
308
309 Additionally, vcsh will source, i.e. execute, all files listed in CON‐
310 FIG. You can put any and all commands into these config files and they
311 will be executed.
312
314 None are known at this time, but reports and/or patches are more than
315 welcome.
316
318 If you rely on git submodule use git 1.7.12 or later. Earlier versions
319 do not clean internal variables properly before descending into submod‐
320 ules, resulting in unhappy end users.
321
323 Like most people, the author initially made do with a single repository
324 for all config files, all of which were soft-linked into $HOME.
325
326 Martin F. Krafft aka madduck came up with the concept of fake bare Git
327 repositories.
328
329 vcsh was initally written by madduck. This version is a re-implementa‐
330 tion from scratch with a lot more features. madduck graciously agreed
331 to let the author take over the name.
332
334 This manpage and vcsh itself were written by Richard "RichiH" Hartmann.
335
337 Copyright 2011-2015 Richard Hartmann richih@debian.org
338
339 Licensed under the GNU GPL version 2 or higher.
340
341 https://github.com/RichiH/vcsh
342
344 git(1), mr(1)
345
346
347
348 December 2015 VCSH(1)