gpt4 book ai didi

git - 将过滤器条目添加到 git 配置文件

转载 作者:行者123 更新时间:2023-12-02 03:22:04 25 4
gpt4 key购买 nike

如果我运行:

git config foo.bar hello

它将以下内容添加到我的存储库的本地 .git\config 文件中:

[foo]
bar = hello

但现在假设我想将以下内容添加到同一配置中(这是 lfs 使用的内容,但这超出了重点):

[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true

问题:是否有 git 命令可以添加此内容?

我无法使 git config 在这里工作,因为 key 需要类似于 filter "lfs".clean 它不会查看作为有效的 key 。

最佳答案

命令是:

$ git config filter.lfs.clean 'git-lfs clean %f'
$ git config filter.lfs.smudge 'git-lfs smudge %f'
$ git config filter.lfs.required true

引号中的部分将成为配置键的第二级。

关于git - 将过滤器条目添加到 git 配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35305503/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com