.git / config文件读取"命令未找到"

时间:2015-03-09 05:31:20

标签: macos git config-files

我正在尝试学习git并使用mac osx 10.8

查看我创建的存储库中的.git / config文件后,文件读取

/.git/config: line 1: [core]: command not found
/.git/config: line 2: repositoryformatversion: command not found
/.git/config: line 3: filemode: command not found
/.git/config: line 4: bare: command not found
/.git/config: line 5: logallrefupdates: command not found
/.git/config: line 6: ignorecase: command not found
/.git/config: line 7: precomposeunicode: command not found
/.git/config: line 8: [remote: command not found
/.git/config: line 9: url: command not found
/.git/config: line 10: fetch: command not found
logout

[Process completed]

当我的课本告诉我时,应该说,

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/joesmith2444/my-first-repository.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

有谁知道原因可能是什么?如果需要任何其他细节,请告诉我。

2 个答案:

答案 0 :(得分:1)

您收到此错误是因为您正在尝试执行配置文件。选择以下选项之一: -

查看文件

cat .git/config

修改文件

nano .git/config

答案 1 :(得分:0)

您不应该尝试执行.git/config文件...您可能想要git clone https://github.com/joesmith2444/my-first-repository.git

还要确保安装了Git。也许你的shell有助于拼写纠正“$ PATH中没有可执行的git二进制文件”来“执行$ PATH中看起来像git的第一件事。”