【问题标题】:git clone makes an error zsh: parse error near '\n'git clone 出错 zsh: parse error near '\n'
【发布时间】:2021-12-28 04:14:52
【问题描述】:

git clone -b (github_id) --single-branch <https://github.com/(github_id)/repository>

那么错误是

zsh: parse error near '\n'

我试过了:

  1. 检查我的 git 配置文件
[user]
    name = (myname)
    email = (myemail)

[core]
    editor = code --wait
    autocrlf = input
[diff]
    tool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE
  1. 检查我的 json 文件
{
    "editor.formatOnSave": true,
    "javascript.preferences.quoteStyle": "single",
    "typescript.preferences.quoteStyle": "single"
}

我能做什么?

【问题讨论】:

  • <> 真的存在吗?
  • git clone 命令中有特殊字符吗?我没用zsh,但是看到stackoverflow.com/questions/22278748/…,好像是某处的一些特殊字符给zsh带来了麻烦。
  • 哦!谢谢.. 问题是<>
  • 尖括号 (git clone <url>) 是一种印刷约定,意思是用适合您情况的内容替换此文本,包括尖括号。方括号 (git clone [-b <branch>] <url>) 表示 可选: 这里,-b(字面意思)和一个空格,然后是一个分支名称,它被括在尖括号中,意味着你应该想出适当的替换文本。

标签: git github parse-error


【解决方案1】:

作为seen here,使用git clone <url> 会触发您看到的错误消息。
相反,这会起作用,没有 <>:

git clone -b github_id --single-branch https://github.com/github_id/repository

【讨论】:

    猜你喜欢
    • 2022-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-08
    • 2023-04-01
    • 1970-01-01
    • 2018-09-28
    相关资源
    最近更新 更多