Reputation: 58808
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.
Upvotes: 2
Views: 1525
Reputation: 2922
Why not just use git submodule
? It does sounds like its what you're looking for: a project that contains other projects.
Upvotes: 0
Reputation: 3709
A symbolic link won't work here. You can set the GIT_CONFIG environment variable to point to your config file instead.
Upvotes: 1
Reputation: 117959
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.
Upvotes: 0