I have a following line in ~/.gitignore
(rules specific to vim):
[._]*.s[a-w][a-z]
And local .gitignore
of the app.
git status -u
prints the following:
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore.swp
and I indeed didn't add the .gitignore.swp
to tracked files cause I don't want to!
If I add that [._]*.s[a-w][a-z]
line to local (project) folder, then git status -u
outputs:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
Which is expected (I track my .gitignore
), but notice that temporary vim file is ignored since la
still prints it.
Since I work with many projects in collaboration with others, I do not want to drag rules that are specific to my work-flow.
Can I have .gitignore
s in a single place that would affect all projects my user is working on?