【问题标题】:fatal: bad config file line 1 in /home/trx/.gitconfig致命:/home/trx/.gitconfig 中的错误配置文件第 1 行
【发布时间】:2013-02-14 14:11:47
【问题描述】:

我知道这个问题已经被问了一百万次了,但是我的 ~/.gitconfig 只包含两行,这在教程中是正确的。

git config --global user.name "trx"
git config --global user.email chazx@live.com

这可能是什么问题?

【问题讨论】:

    标签: linux git ubuntu


    【解决方案1】:

    这是我的 ~/.gitconfig:

    [user]
        name = Luigi R. Viggiano
        email = luigi.viggiano@...
    [color]
        ui = true
    [merge]
        tool = p4merge
    [diff]
        tool = p4merge
    [push]
        default = simple
    

    您的~/.gitconfig 格式不正确。

    你不需要输入命令:

    git config --global user.name "trx"
    git config --global user.email chazx@live.com
    

    在文件中...您需要在终端上键入它们。

    删除您的~/.gitconfig 并在终端使用git config 命令对其进行操作,如教程中所述。

    【讨论】:

    • 哇,这很有趣。我认为这些是从文件中读取时会运行的命令。非常感谢。 (5分钟接受)
    【解决方案2】:

    这些git config 行是您应该运行的命令,而不是配置文件的内容。

    【讨论】:

      猜你喜欢
      • 2019-12-08
      • 1970-01-01
      • 2021-03-06
      • 2015-01-20
      • 2016-08-22
      • 2011-04-19
      • 2018-04-18
      • 2015-05-31
      • 1970-01-01
      相关资源
      最近更新 更多