Skip to content

Instantly share code, notes, and snippets.

Created July 8, 2016 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/10af84f8b9bc07e30b16e4889faa107a to your computer and use it in GitHub Desktop.
Save anonymous/10af84f8b9bc07e30b16e4889faa107a to your computer and use it in GitHub Desktop.
$ git --version
git version 2.8.0.rc3.226.g39d4020
$ ls -a
. ..
$ mkdir -p foo/bar/; touch {,foo/,foo/bar/}{a,b,c}; echo '/*' > .gitignore;
$ find -type f | sort
./b
./a
./c
./foo/a
./foo/bar/a
./foo/bar/b
./foo/bar/c
./foo/b
./foo/c
./.gitignore
$ cat .gitignore
/*
$ git init
Initialized empty Git repository in /tmp/test/.git/
$ git status --porcelain --ignored --untracked-files=all
!! .gitignore
!! a
!! b
!! c
!! foo/a
!! foo/b
!! foo/bar/a
!! foo/bar/b
!! foo/bar/c
!! foo/c
$ cat >> .gitignore
!/foo/bar/
$ cat .gitignore
/*
!/foo/bar/
$ git status --porcelain --ignored --untracked-files=all
?? .gitignore
?? a
?? c
!! b
!! foo/a
!! foo/b
!! foo/bar/a
!! foo/bar/b
!! foo/bar/c
!! foo/c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment