I have editor settings that I want to spread in all repositories. If the user defines its own settings, it should erase the repository choices of course.
I want to do that because I have a class and every student clone the repo. Usually they forget to set the core.editor setting and ends up messing around with vi, usually crashing the repo just like if they have cursed magical power.
As it worked for my HOME dir, I tried to use a .gitconfig in my repo dir, like I would set a .gitignore, but it doesn't seem to work.
EDIT :
--global
DOES let the user set its preference to override the repo, but it DOES'T allow him to fetch the repos config while cloning it.If you want to check your configuration settings, you can use the git config --list command to list all the settings Git can find at that point: $ git config --list user.name=John Doe user.
Distribute your repo using rsync or tar/untar, rather than using "git clone", which as you have seen, does not copy repo-special files.
I do this by moving the config file up to the working dir to get it versioned.
Then you could ask the other person to make a link to the config:
$ rm .git/config
$ cd .git
$ ln -s ../config config
You could then write this in a script or in one line to let them copy and paste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With