Keeping a "global" git-ignore file under version control

Michael Henry vcs-home at drmikehenry.com
Mon Jan 3 01:05:10 CET 2011


All,

I've just started using git to version control my home directory
(including my ~/.gitconfig file).  I'd like to configure git's
core.excludesfile setting to point to ~/.gitglobalignore.  This
setting requires an absolute path.  So in my ~/.gitconfig file,
this works::

  [core]
      # This works because the path is absolute:
      excludesfile = /home/mike/.gitglobalignore

But because neither environment variables nor "~" are expanded,
neither of the following work::

  [core]
      # Neither of these will work:
      excludesfile = ~/.gitglobalignore
      excludesfile = $HOME/.gitglobalignore

Since I'm keeping ~/.gitconfig under version control, I don't
see how to share this configuration with multiple users (in
particular, with root, but I'd also like to share it with
coworkers if my experiments at home pan out).

Have any of you run into this problem and found a work-around?
I've seen a proposal for a git patch[1] for this, but the
conversation stopped in August 2008.

Thanks,
Michael Henry

[1]:
http://git.661346.n2.nabble.com/PATCH-Support-quot-core-excludesfile-gitignore-quot-td742043.html



More information about the vcs-home mailing list