]> git.madduck.net Git - code/vcsh.git/blobdiff - 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:

Merge pull request #205 from harendra-kumar/master
[code/vcsh.git] / doc / sample_hooks / post-init-add-origin
index a3030d5fa524301b4f8a2272d7719aee32e2d161..993f3c705aa9517db8d3b0d9d29e6a47a8a20af9 100755 (executable)
@@ -1,6 +1,18 @@
 #!/bin/sh
 
-# This adds a remote origin at $GITURL/dotfiles/$VCSH_DIRECTORY
-# Assumes $GITURL is set to the base of your remote repos.
+# This adds a remote origin at $GITURL/dotfiles/$VCSH_DIRECTORY which
+# is helpful for creating new dotfile repositories that you plan to
+# store on (e.g.) Github.
+#
+# You must set $GITURL in order to use this hook. For example, add the
+# following to your .bashrc (or equivalent for your shell), replacing
+# YOURUSERNAME with your github username:
+#
+# export GITURL="git@github.com:YOURUSERNAME"
+
+if [ -z $GITURL ]; then
+    echo "\$GITURL is not set; please see post-init-add-origin hook"
+    exit 1;
+fi
 
 vcsh $VCSH_DIRECTORY remote add origin $GITURL/dotfiles/$VCSH_DIRECTORY