I'm syncing ~/.gitconfig
and ~/.gitignore
files in ubuntu and Mac by using dropbox and created symlink for it.
And excludesfile
is declared like this.
[core]
editor = /usr/bin/vim
excludesfile = /Users/username/.gitignore
The problem is home directory differs by os, therefore I need multiple setting for excludesfile.
Is it possible to define multiple core.excludesfile
?
.gitconfig
is actually under version control by git. Unfortunately, git expands~
to be the full path to$HOME
and updates the.gitconfig
itself with the absolute path. That behavior is fine, but then it shows up as an unstaged change, so I usegit update-index --assume-unchanged .gitconfig
to ignore the expansion (along with the rest of the file). – Dolph Oct 08 '14 at 16:51~
to be expanded? I get:git config --global core.excludesfile '~/.gitignore'; git config --global core.excludesfile
→~/.gitignore
(git 1.7.9.5) – Gilles 'SO- stop being evil' Oct 08 '14 at 17:22git config --global core.excludesfile ~/.gitignore
then what is actually run isgit config --global core.excludesfile /path/to/home/.gitignore
. – Resigned June 2023 Sep 23 '16 at 03:07~/.config/git/ignore
if it exists is globally ignored automatically, with no global configuration necessary. – Asclepius Oct 03 '16 at 22:54