[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] trouble with .gitignore patterns



Hi,

This has been a longstanding problem. This is actual copy-paste from the 
shell, if you spot any errors they are real. I read gitignore(5) and 
searched the net, but still don't get it :(

$ git init
Initialized empty Git repository in /home/amp/Download/gitest/.git/
$ mkdir dir ; touch file1 file2 dir/file3
$ git status -s
?? dir/
?? file1
?? file2
$ echo 'dir/' > .gitignore
$ git status -s
?? .gitignore
?? file1
?? file2

# nothing unexpected so far

$ echo '*' > .gitignore
$ git status -s
$ echo '!file1' >> .gitignore
$ echo '!dir/' >> .gitignore
$ git status -s
?? file1
$ 

Why is 'dir' still ignored?

I'm tracking all files I care about in git, but instead of ignoring a 
lot of stuff that comes and goes (maintaining .gitignore would be a 
pain) I thought it would be better if I just ignore everything and then 
specifically include what I need. This works for individual files, but 
not with complete directories and I don't understand why.

Thanks for reading,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic

Attachment: signature.asc
Description: Digital signature


Reply to: