How share a config file in git?

天大地大妈咪最大 提交于 2019-12-04 23:32:17

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.

You could create a shell script in the repo that sets these values through git config. That would allow the students to see how they do it themselves, and it gives them a way to undo their local settings.

Unfortunately, this wouldn't be automatic.

Example:

#! /bin/sh
git config core.editor "ed"

Global settings can be set via: git config --global

Maybe you should first let the students clone the configuration file (from its own repository) to their home directories.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!