I have some files like vim.gitignore
, SVN.gitignore
and CVS.gitignore
(spread around on my hard disk).
Can I simply include these gitignore files in a .gitignore
file in a new Git project?
Edit: I have a global ignore file already.
I just want to ignore different files in different types of projects, is this possible?
You could:
xxx-gitignore-xxx
" in it (in other word, with a content you can easily identify.gitattribute
filter driver(for each new repo, you clone it and can start with those files already there.
Then you remove the remote 'origin' or replace it by whatever remote repo you want to push to)
On any checkout of your repo, the filter driver will, through the smudge script:
.gitignore
filexxx.gitignore
content isn't already there (by looking for a specific string which only those files have)xxx.gitignore
files.gitignore
.Note that having a identifiable content is key here, since a filter driver script doesn't have the name/path of the file it filters.
It is a bit convoluted, but seems to be the only way to implement the "include" feature you want.
The closes you will get is the global ignore file:
which is of course like having a
.gitignore
in the repo, but applicable to all repos on your system ( and not propagated to external clones.)