VCSH(1)
π VCSH(1) β the vcsh manual page, bestie edition β¨
okay so you opened the manual page for vcsh, and I'm gonna walk you through it like we're on FaceTime at 1am. it's the General Commands Manual entry, and no cap, it's lowkey iconic. let's go π«Ά
β¨ NAME β¨
vcsh β Version Control System for $HOME β multiple Git repositories in $HOME. literally that's the whole vibe. π
πΈ SYNOPSIS πΈ
vcsh [options] command
vcsh clone [-b branch] url [repo]
vcsh delete repo
vcsh enter repo
vcsh foreach [-g] git command
vcsh help
vcsh init repo
vcsh list
vcsh list-tracked [repo]
vcsh list-untracked [-a] [-r] [repo]
vcsh pull
vcsh push
vcsh rename repo newname
vcsh run repo shell command
vcsh status [repo]
vcsh upgrade repo
vcsh version
vcsh which substring
vcsh write-gitignore [repo]
vcsh repo gitcommand
vcsh repo
every single one of those is real, I promise. don't skip any. π
π¦ DESCRIPTION π¦
okay so the whole point: vcsh lets you have several git(1) repositories, and they all keep their working trees in $HOME without clobbering each other. that's the slay. π
which means β hear me out β you can have one repository per config set (zsh, vim, ssh, etc), and then you just pick and choose which configs you want on which machine. it's giving main character energy for your dotfiles.
the technique under the hood is called fake bare Git repositories β it keeps $GIT_DIR in a different directory from $GIT_WORK_TREE, and $GIT_WORK_TREE is pointed to $HOME. β¨
and the best part? no symlinks needed in this setup, so your setup stays cleaner. periodt.
vcsh was designed with mr(1) in mind, so you might wanna install it alongside vcsh. that said, you can easily use vcsh without mr if that's more your vibe β no pressure, fr fr.
a sample configuration for vcsh and mr lives at https://github.com/RichiH/vcsh_mr_template and you can use it with:
vcsh clone https://github.com/RichiH/vcsh_mr_template mr
π‘ one thing to remember: you can always use a path instead of a name for repo. this is needed to support mr and other scripts properly, and it's of no concern to an interactive user β so don't stress, bestie. π«Ά
π OPTIONS π
-cβ source file prior to other configuration files-dβ enable debug mode-vβ enable verbose mode
short, sweet, iconic. β¨
π COMMANDS π
cloneβ clone an existing repository.
if you need to clone a bundle of repositories, look into the post-clone-retired hook. π
you can also use a single git repository with several branches. use the -b option to specify a branch at clone time; the default is master.
commitβ commit in all repositories.deleteβ delete an existing repository. ποΈenterβ enter repository; spawns a new$SHELLwith$GIT_DIRset.foreachβ execute git command for every vcsh repository.-g: execute in general context.
helpβ display help. we love a self-aware king.initβ initialize an empty repository.listβ list all local vcsh repositories.list-trackedβ list all files tracked by vcsh.
if you want to list files tracked by a specific repository, simply append the repository's name last. π«Ά
list-tracked-byβ list files tracked by a repository.
β οΈ this is a legacy command; you should use list-tracked <repo> instead.
list-untrackedβ list all files NOT tracked by vcsh.-a: show all files. by default,git ls-files --exclude-standardis called.-r: recursive mode. by default, the file list is shallow and stops at directory levels where possible.$repo: list files not tracked by this specific repository.
pullβ pull from all vcsh remotes.pushβ push to all vcsh remotes.renameβ rename a repository.runβ run command with$GIT_DIRand$GIT_WORK_TREEset. this lets you run any and all commands with no restrictions. use with care, bestie. π
π‘ please note there's a somewhat magic feature forrun. instead of repo it also accepts path. anything that has a slash in it will be assumed to be a path.vcsh runwill then operate on this directory instead of the one normally generated from the repository's name. this is needed to supportmrand other scripts properly, and is of no concern to an interactive user.
statusβ show statuses of all/one vcsh repositories.upgradeβ upgrade repository to currently recommended settings. glow-up time β¨versionβ print version information.which substringβ find substring in the name of any tracked file. iykyk πwrite-gitignoreβ write.gitignore.d/repo viagit ls-files. if repo is not specified but we're withing a vcsh repository, use that. (yes, "withing" β we keep the original's typo energy, it's part of the lore π«Ά)repo gitcommandβ shortcut to run git commands on a repo. will prependgitto gitcommand.repoβ shortcut to runvcsh enter <repo>.
π ENVIRONMENT π
as noted earlier, vcsh will set $GIT_DIR and $GIT_WORK_TREE to the appropriate values for fake bare Git repositories. that's the whole trick, and it ate. π
π§ CONFIG π§
there are several ways to turn the various knobs on vcsh. in order of ascending precedence, they are:
VARIABLE=foo vcsh/etc/vcsh/config$XDG_CONFIG_HOME/vcsh/configvcsh -cfile
β οΈ please note those files are sourced, i.e. executed. any and all commands will be executed in the context of your shell. so like, be normal about what you put in there. π
π interesting knobs you can turn
$VCSH_GITATTRIBUTESβ can benone, or any other value.nonewill not maintain Git attributes in a special location.- if set to any other value, repo-specific gitattributes files will be maintained.
- defaults to
none.
$VCSH_GITIGNOREβ can beexact,none, orrecursive.exactwill seed the repo-specific ignore file with all file and directory names whichgit ls-filesreturns.nonewill not write any ignore file.recursivewill descend through all directories recursively, additionally to the above.- defaults to
exact.
$VCSH_WORKTREEβ can beabsolute, orrelative.absolutewill set an absolute path, defaulting to$HOME.relativewill set a path relative to$GIT_DIR.- defaults to
absolute.
πΈ less interesting knobs you could turn
$VCSH_DEBUGβ enter debug mode.$XDG_CONFIG_HOMEβ as specified in the 'XDG Base Directory Specification', seehttp://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html. defaults to$HOME/.config.$VCSH_REPO_Dβ the directory where repositories are read from and stored. defaults to$XDG_CONFIG_HOME/vcsh/repo.d.$VCSH_HOOK_Dβ the directory where hooks are read from. defaults to$XDG_CONFIG_HOME/vcsh/hooks-enabled.$VCSH_BASEβ the directory where repositories are checked out to. defaults to$HOME.
β HOOK SYSTEM β
vcsh provides a hook system, and honestly? obsessed. hook scripts must be executable and should be placed in $XDG_CONFIG_HOME/vcsh/hooks-available. from there, they can be soft-linked into $XDG_CONFIG_HOME/vcsh/hooks-enabled; vcsh will only execute hooks that are in this directory. π₯
hooks follow a simple format. pre-run will be run before anything is run. if you want more than one script for a certain hook, just append any kind of string to order them. a system of pre-run, pre-run.10, pre-run.20 etc is suggested; other options would be pre-run-10 or pre-run.sh. a dot after the hook name is optional. π
if you want to create hooks for a specific vcsh repository, simply prepend the repository's name, followed by a dot, i.e. zsh.pre-run. otherwise, the same rules as above apply. the dot between the repository's name and the hook is mandatory, though. no skipping it.
available hooks are: pre-clone, post-clone, post-clone-retired, pre-command, post-command, pre-enter, post-enter, pre-init, post-init, pre-pull, post-pull, pre-push, post-push, pre-run, post-run, pre-upgrade, and post-upgrade. if you need more, vcsh is trivial to patch, but please let upstream know so they can ship them by default. π«Ά
π OVERLAY SYSTEM π
vcsh also provides an overlay system. similar to hooks, the recommended locations are $XDG_CONFIG_HOME/vcsh/overlays-available and $XDG_CONFIG_HOME/vcsh/overlays-enabled.
overlays follow the same rules as hooks, and you are free to overwrite any and all functions. same as hooks, you can use global or repository-specific overlays by using either $VCSH_OVERLAY_D/$VCSH_COMMAND or $VCSH_OVERLAY_D/$VCSH_REPO_NAME.$VCSH_COMMAND.
β οΈ DANGER, BESTIE β οΈ please note that nothing stops you from, e.g. overwritingstatus()in$VCSH_OVERLAY_D/commit. as the overlays will be sourced and you are replacing arbitrary functions, any and all features may stop working, or you may even lose data.
you have been warned. ππ
π₯ DETAILED HOWTO AND FURTHER READING π₯
manpages are often short and sometimes useless to glean best practices from. while the author tried to avoid this in this case, manpages can not cover detailed howtos. (they said it, not me.)
this software also comes with a file called README.md. it contains various approaches to setting up and using vcsh. you can view the file as plain text, or render it into various other formats via Markdown. β¨
on Debian-based systems, this file can be found in /usr/share/doc/vcsh.
π SECURITY CONSIDERATIONS π
vcsh allows you to execute arbitrary commands via vcsh run. for example, adding a sudo(8) rule for vcsh would be pretty stupid. like, genuinely. don't. π
additionally, vcsh will source β i.e. execute β all files listed in CONFIG. you can put any and all commands into these config files and they will be executed. that's not a bug, that's the design, but also, be careful.
π BUGS π
none are known at this time, but reports and/or patches are more than welcome. π«Ά
π INTEROPERABILITY π
if you rely on git submodule, use git 1.7.12 or later. earlier versions do not clean internal variables properly before descending into submodules, resulting in unhappy end users. and we do not want unhappy end users. π
π HISTORY π
like most people, the author initially made do with a single repository for all config files, all of which were soft-linked into $HOME. relatable.
Martin F. Krafft aka madduck came up with the concept of fake bare Git repositories. king behavior.
vcsh was initially written by madduck. this version is a re-implementation from scratch with a lot more features. madduck graciously agreed to let the author take over the name. π
π AUTHOR π
this manpage and vcsh itself were written by Richard "RichiH" Hartmann. we stan. β
π§ COPYRIGHT π§
Copyright 2011-2015 Richard Hartmann richih@debian.org
Licensed under the GNU GPL version 2 or higher.
https://github.com/RichiH/vcsh
π SEE ALSO π
aaand that's the page! π cute sign-off time: this was the vcsh page dated April 2024, straight from the vcsh project itself β so if you're reading a stale copy, go check upstream. mwah. π«Άβ¨π
π¦ where this page comes from
- arch rolling: vcsh 2.0.10-2 Β· GPL-2.0-only
- nixpkgs unstable: vcsh 2.0.10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms