will adding .gitconfig in repository override my global .gitconfig file configurations?

爷,独闯天下 提交于 2020-01-04 05:32:26

问题


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

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?

Any help is greatly appreciated


回答1:


Yes, the settings in the .gitconfig checked into a particular repository will override your global .gitconfig settings.

See this link:

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:

  • 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.

Also from git-scm.com (edited for clarity):

The files are read in order, with (the repository specific .gitconfig) found taking precedence over (other .gitconfig files).



来源:https://stackoverflow.com/questions/35616236/will-adding-gitconfig-in-repository-override-my-global-gitconfig-file-configur

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