From 29ef3f0033ddf20924c38fa725ea8b40035ba170 Mon Sep 17 00:00:00 2001 From: Milen Igrachev Date: Sat, 24 Feb 2018 10:12:25 +0200 Subject: [PATCH] Enhancing pre-commit bash script documentation. (#3638) * Enhancing pre-commit bash script documentation. * Correcting typo. * attempt to correct lint problem * Grammar clarification. * Further styling correction Mark .git/hooks/post-commit as ```code``` * Remove redundant exit 0 from post-install script. * Insert newline --- docs/precommit.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/precommit.md b/docs/precommit.md index c566d5941..cdd43e947 100644 --- a/docs/precommit.md +++ b/docs/precommit.md @@ -110,3 +110,12 @@ echo "$jsfiles" | xargs git add exit 0 ``` + +If git is reporting that your prettified files are still modified after committing, you may need to add a post-commit script to update git's index as described in [this issue](https://github.com/prettier/prettier/issues/2978#issuecomment-334408427). + +Add something like the following to `.git/hooks/post-commit`: + +```bash +#!/bin/sh +git update-index -g +```