0

I want to store my .gitconfig on github so that I can quickly set up a new machine by cloning it.

The solution for other config files like .emacs or .spacemacs is to put them in a folder (.emacs.d and .spacemacs.d respectively). Is it possible to do the same with .gitconfig?

Heisenberg
  • 8,386
  • 12
  • 53
  • 102
  • You could store it in the repository but it won't take effect as soon as one clones the repository. See https://www.git-scm.com/docs/git-config#FILES. – ElpieKay Oct 17 '17 at 03:59
  • 1
    Possible duplicate of [Storing git config as part of the repository](https://stackoverflow.com/questions/18329621/storing-git-config-as-part-of-the-repository) – kowsky Oct 17 '17 at 06:06

3 Answers3

2

.gitconfig is always located in your home directory, but you can instead move the file where you want and create a symbolic link to it in your home directory.

1615903
  • 32,635
  • 12
  • 70
  • 99
0

You can put .gitconfig file to home directory when cloned it from github.

seay
  • 599
  • 5
  • 8
0

You can use .config/git/config (or set XDG_CONFIG_HOME to put it anywhere you like).

Davis Herring
  • 36,443
  • 4
  • 48
  • 76