将在仓库中添加.gitconfig会覆盖我的全局.gitconfig文件配置吗? [英] will adding .gitconfig in repository override my global .gitconfig file configurations?
问题描述
我将我的项目托管在TFS-GIT服务器中.我在TFS上的合并请求存在问题.一种选择是更新TFS服务器本身上的git configs,使其由于时间紧迫和其他无法尽快解决的问题而合并--no--ff".我正在寻找解决此问题的方法
I am having my project hosted in TFS-GIT server. I am having an issue with pull request merges on TFS . one option is to update git configs on TFS server itself to make "merges --no--ff" because of time crunch and other issues that cannot be done sooner . I am looking for a workaround for this issue
如果我将.gitconfig文件添加到带有合并.ff和pull.ff为false的存储库中,是否会覆盖在存储库级别应用的配置?可以和git一起使用吗?
If i add .gitconfig file to the repository with merge .ff and pull.ff to false will that override configs applied at repository level ? will that work like that with git?
非常感谢您的帮助
推荐答案
是的,.gitconfig
中检入特定存储库的设置将覆盖您的全局.gitconfig
设置.
Yes, the settings in the .gitconfig
checked into a particular repository will override your global .gitconfig
settings.
请参见此链接:
.gitconfig文件最多可以位于您的计算机中的三个位置 文件系统,该位置确定文件的范围 内容被考虑:
A .gitconfig file can reside in up to three locations within your filesystem, the location determining the scope in which the file's contents are considered:
- 全局(〜/.gitconfig):最常见的用法是建立全局 特定用户的配置选项.
- 系统(/etc/.gitconfig): 很少使用,可以为整个 本地系统(此计算机上的所有用户).
- 本地:在存储库级别, 建立仅影响此存储库的配置选项.如果 提交此文件后,其中包含的设置将影响 克隆此存储库的所有用户.
- Global (~/.gitconfig): The most common use, establishes global configuration options for a particular user.
- System (/etc/.gitconfig): Rarely used, establishes configuration options for the entirety of the local system (all users on this computer).
- Local: At the repository level, establishes configuration options that only affect this repository. If this file were committed, the settings contained within would impact all users that clone this repository.
也来自 git-scm.com (为清晰起见进行了编辑):
Also from git-scm.com (edited for clarity):
使用(存储库 发现特定的
.gitconfig
)优先于(其他.gitconfig
文件).
The files are read in order, with (the repository specific
.gitconfig
) found taking precedence over (other.gitconfig
files).
这篇关于将在仓库中添加.gitconfig会覆盖我的全局.gitconfig文件配置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!