新的git存储库的默认配置设置? [英] Default config settings for a new git repository?
问题描述
当我创建一个新的git存储库时,一些配置设置会自动添加到 .git / config 。在哪里可以更改这些默认设置?
When I create a new git repository, some configurations settings are automatically added to .git/config. Where can I change these default settings?
推荐答案
考虑 git init
:
--template=<template_directory>
提供将使用模板的目录。默认模板目录为
/ usr / share / git-core / templates
。
$ c>< template_directory> 用作模板文件的源而不是默认值。
模板文件包括一些目录结构,一些建议排除模式和不执行的钩子文件的副本。
When specified, <template_directory>
is used as the source of the template files rather than the default.
The template files include some directory structure, some suggested "exclude patterns", and copies of non-executing "hook" files. The suggested patterns and hook files are all modifiable and extensible.
如果你看一下git的源代码,可以修改创建新的数据库,您可以包括一个配置文件,其中包含默认值。
If you look at the git sources for creating a new db, you could include a config file with your default value there.
function create_default_files()
有:
/* First copy the templates -- we might have the default
* config file there, in which case we would want to read
* from it after installing.
*/
copy_templates(template_path);
git / config.c 具有设置默认值的 git_default_core_config()
函数。
The git/config.c has the git_default_core_config()
function which set default values.
这篇关于新的git存储库的默认配置设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!