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

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


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::

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

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

      # 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.

Michael Henry


More information about the vcs-home mailing list