]> git.madduck.net Git - code/vcsh.git/blob - doc/sample_hooks/post-init-add-origin

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

vcsh: Make `vcsh which dontexist` exit 1
[code/vcsh.git] / doc / sample_hooks / post-init-add-origin
1 #!/bin/sh
2
3 # This adds a remote origin at $GITURL/dotfiles/$VCSH_DIRECTORY which
4 # is helpful for creating new dotfile repositories that you plan to
5 # store on (e.g.) Github.
6 #
7 # You must set $GITURL in order to use this hook. For example, add the
8 # following to your .bashrc (or equivalent for your shell), replacing
9 # YOURUSERNAME with your github username:
10 #
11 # export GITURL="git@github.com:YOURUSERNAME"
12
13 if [ -z $GITURL ]; then
14     echo "\$GITURL is not set; please see post-init-add-origin hook"
15     exit 1;
16 fi
17
18 vcsh $VCSH_DIRECTORY remote add origin $GITURL/dotfiles/$VCSH_DIRECTORY