tags:

views:

41

answers:

2

I've got a repository which contains most of my application settings. I'd like to add .git/config from a different repo and replace it with a symlink in the original repo, but Git complains:

error: Invalid path '[...]/.git/config'
error: unable to add [...]/.git/config to index
fatal: adding files failed

Note: I'm not trying to add this to the root directory of the settings repo, but in a subdirectory.

A: 

Just put those settings in your global .gitconfig so it will apply to all repositories on your system – and remove them from the local .git/config so they won’t override your changes in .gitconfig as your preferences change and you update that.

Aristotle Pagaltzis
There's also a system-wide config in `$(prefix)/etc/gitconfig`.
Jefromi
The settings I'm most interested in backing up are the remotes and branches - I don't want those in my global configuration.
l0b0
+1  A: 

Hi,

A symbolic link won't work here. You can set the GIT_CONFIG environment variable to point to your config file instead.

Ramkumar Ramachandra