From 55bfebbc21acd96417bba2d7ee290ed3c6c1e4ac Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Fri, 4 Sep 2015 11:09:32 +0200 Subject: [PATCH] Updated documentation for git-ignore * Updated output for `git ignore` * Added description and examples for `git ignore -g` and `git ignore -l` --- Commands.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Commands.md b/Commands.md index 32c853e..bda485a 100644 --- a/Commands.md +++ b/Commands.md @@ -374,10 +374,35 @@ $ git ignore build "*.o" "*.log" ... added '*.log' ``` -Without any patterns, `git-ignore` displays currently ignored patterns: +Without any patterns, `git-ignore` displays currently ignored patterns in both your global and your local `.gitignore` files: ```bash $ git ignore +Global gitignore: /Users/foo/.gitignore_global +*~ +.metadata +--------------------------------- +Local gitignore: .gitignore +build +*.o +*.log +``` + +To show just the global or just the local file's contents, you can use the following optional parameters: + +* `-g` or `--global` to show just the global file +* `-l` or `--local` to show just the local file + +```bash +$ git ignore -g +Global gitignore: /Users/foo/.gitignore_global +*~ +.metadata +``` + +```bash +$ git ignore -l +Local gitignore: .gitignore build *.o *.log