From b121261cc1cf522656e1cf0b45f5183934d79ea4 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Fri, 26 May 2017 15:17:26 -0700 Subject: [PATCH] git hook info --- views/cli.erb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/views/cli.erb b/views/cli.erb index 5a47cdee..d326e868 100644 --- a/views/cli.erb +++ b/views/cli.erb @@ -55,5 +55,23 @@ Subcommands: sudo apt-get install ruby-full A full list of available install options for ruby is here. + + +

Git Hooks

+ +

+ If you want to create a git hook to automatically upload your site to Neocities when you run "git push", you can + run this command in the root directory of your git repo: +

+ +
printf '#!/bin/sh\nneocities push .' >.git/hooks/pre-push && \
+chmod u+x .git/hooks/pre-push
+ +

If the files you're pushing are in a subdirectory of the root git repo, replace the "." with the subdirectory. For example, with Jekyll (which typically uses _site):

+ +
printf '#!/bin/sh\nneocities push _site' >.git/hooks/pre-push && \
+chmod u+x .git/hooks/pre-push
+ +

Note: You will need to be logged in for the git hook to work, so run "neocities push" on the directory you want to upload before installing this hook. This will be fixed in a later version of the CLI.