gitignore excludes not working?
- From
Martin Langhoff <martin.langhoff@gmail.com>
- Date
- Dec 6, 2013, 17:26 UTC
- Message-ID
- <CACPiFCJ0Jj1M8KCrwus=DeRSBE2O3HKhvEo-UJhHoZDhHTzsSA@mail.gmail.com>
Tested with git 1.7.12.4 (Apple Git-37) and git 1.8.3.1 on F20.
$ mkdir foo $ cd foo $ git init Initialized empty Git repository in /tmp/foo/.git/ $ mkdir -p modules/boring $ mkdir -p modules/interesting $ touch modules/boring/lib.c $ touch modules/interesting/other.c $ touch modules/interesting/lib.c $ git add modules/interesting/lib.c $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: modules/interesting/lib.c # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # modules/boring/ # modules/interesting/other.c
$ echo '/modules/' > .gitignore $ echo '!/modules/interesting/' >> .gitignore
On this git status, I would expect to see modules/interesting/other.c listed as untracked, however:
$ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: modules/interesting/lib.c # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # .gitignore
thoughts?
m
-- martin.langhoff@gmail.com - ask interesting questions - don't get distracted with shiny stuff - working code first ~ http://docs.moodle.org/en/User:Martin_Langhoff