是[---]在.gitconfig中的注释? [英] Is [---] a comment in .gitconfig?

查看:965
本文介绍了是[---]在.gitconfig中的注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题基于此主题 a>。



在Git中的注释是 [---] $ c>%tool = opendiff%一次在我的 .gitconfig

我想你问的是 .gitconfig 中的方括号语法是否意味着重要。答案是肯定的,它将 .gitconfig 分成几个部分。每个部分都有一个名称,显示在方括号之间。例如:

  [core] 
repositoryformatversion = 0
filemode = true
bare = false

在上面的示例中,节名称为 core 。如果您将 core 改为其他格式,Git将无法找到例如 bare 选项,因为它需要在核心部分。



git-config(1)手册页有一整个部分描述配置文件的格式。


This question is based on this thread.

Is [---] a comment in Git such that I can use only % tool=opendiff % once in my .gitconfig?

解决方案

I think you are asking whether the square bracket syntax in .gitconfig means something significant. The answer is yes, it separates .gitconfig into sections. Each section has a name, shown between the square brackets. For example:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false

In the above example, the section name is core. If you change the word core to something else, Git won't be able to find, for example, the bare option because it needs to be inside the core section.

The git-config(1) manual page has a whole section describing the format of the configuration file.

这篇关于是[---]在.gitconfig中的注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆