From 669e4d9581de0e455d94b52d13f1dd4276e697c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Wed, 11 Feb 2015 20:07:10 +0200 Subject: [PATCH] Updated docs --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index bf9b84f..62f6577 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,23 @@ $ npm install -g git-stats ### Catching the `git commit` command Would you like to catch and automatically store the commits when you do `git commit`? +#### Using `git` hooks +The way I recommend to track your git commits is to use git hooks. Run the following command to initialize the `post-commit` git hook. + +```sh +# Using curl +curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/git-hooks/scripts/init-git-post-commit | bash + +# ...or wget +wget -qO- https://raw.githubusercontent.com/IonicaBizau/git-stats/git-hooks/scripts/init-git-post-commit | bash +``` + +Then, you have to run `git init` into your existing git repositories from your local machine (that's because the `post-commit` should be updated). This +step will not be needed after clonning a repository (the git hooks will be added automatically from `~/.git-templates`). + +#### Overriding the `git` command +One of the solutions is becoming a mad scientist, overriding the `git` command with a function. However, this may not work for you if you're using `zsh`. + If so, put the following lines in your `~/.bashrc` (or `~/.bash_profile` on OS X) file: ```sh