git - 阻止 Gitconfig 文件被本地 .git/config 覆盖
问题描述
最近我开始在我的 git 配置中使用 includeIf 功能来处理不同项目的多个 git 用户帐户,但是我遇到了一个让我发疯的问题。
脚本的 includeIf 部分似乎覆盖了主 git 配置文件。即使我没有使用应该应用它的存储库。
这是我的.gitconfig
:
[user]
name = Default Gitlab
email = default.gitlab@project1.com
[includeIf "gitdir:~/repos/project2/"]
path = ~/.gitconfig-github
和.gitconfig-github
[user]
name = Another Github
email = another.github@project2.com
问题是,过了一会儿我的.gitconfig
样子是这样的:
[user]
name = Another Github
email = another.github@project2.com
[includeIf "gitdir:~/repos/project2/"]
path = ~/.gitconfig-github
我真的无法弄清楚为什么或如何发生这种情况。
感谢你的帮助!
########
# Edit #
########
我注意到不完全includeIf
是这样做的。每次我的仓库本地 git 配置发生更改时,似乎都会发生更改。
还在努力想办法...
解决方案
推荐阅读
- liquid-haskell - LiquidHaskell:函子定律
- node.js - 如何将 { useUnifiedTopology: true } 传递给我独特的 Node.Js Mongoclient 构造函数
- python - 从具有现有表单的视图中更新 django 中的 db 字段,由于“完整性错误”而不会更新
- python - 从列表python中提取数据
- c# - C#如何从另一个方法传递数组
- django - 我无法在我的模板中呈现我的 url 它给了我错误呈现
- css - CSS 网格:网格间隙(排水沟)和网格线之间的关系
- ruby-on-rails - 在 Elastic Beanstalk 上将 Redis 与 Rails 结合使用
- mysql - 根据另一个表中的条件删除表条目
- c# - 字符串c#中的最后一个单词和第一个单词