0

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 .gitignores in a single place that would affect all projects my user is working on?

julka
  • 1,172
  • 2
  • 13
  • 29
  • To keep the Vim swap file clutter down consider moving all the swap files to a central location. e.g. `set directory^=~/.local/vim/tmp//`. See `:h 'directory'` for more information. – Peter Rincker Mar 06 '15 at 17:49
  • I don't believe `~/.gitignore` is ever consulted, unless the project you happen to be working with is your home directory... Or, maybe that's a new feature in recent versions of `git` that I haven't had time to upgrade to yet... – twalberg Mar 06 '15 at 19:07

1 Answers1

0

Have it as ~/.config/git/ignore

julka
  • 1,172
  • 2
  • 13
  • 29