开发者

Add .git/config to another Git repository

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 subdirector开发者_如何学运维y.


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


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.


Why not just use git submodule? It does sounds like its what you're looking for: a project that contains other projects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜