【问题标题】:git clone command line is not working for a repo on githubgit clone 命令行不适用于 github 上的 repo
【发布时间】:2022-01-10 02:20:16
【问题描述】:

我正在按照 Github 上的代码说明进行操作。第一步是说 打开终端,切换到 ANNA-PALM 源代码文件夹。 然后就是这个命令行

git clone https://github.com/imodpasteur/ANNA-PALM
cd ANNA-PALM

当我在 spyder(在 anaconda 中)上运行它时,我得到了这个错误

File "<ipython-input-24-b04c1bbc8ffc>", line 1
  git clone https://github.com/imodpasteur/ANNA-PALM
        ^
SyntaxError: invalid syntax

【问题讨论】:

  • 那不是 Python 代码。您正在 Python 解释器中运行 UNIX/Linux/Windows 终端/控制台命令。您必须在终端或命令提示符下运行它。
  • 这是命令行语法,不是 python。使用终端查看 repo。
  • 谢谢,我在命令提示符下试过了,但得到了这个错误
  • 你的系统上安装了 git 吗?
  • @user14492868 你必须安装 git 才能使用 git...

标签: python git github clone


【解决方案1】:

这应该在终端/cmd not python shell

中运行
  1. 在您希望添加克隆存储库的目录中打开文件资源管理器

  2. 在目录栏输入cmd

  3. 在cmd中输入:

    git clone https://github.com/imodpasteur/ANNA-PALM
    cd ANNA-PALM
    

【讨论】:

  • 不幸的是,我遇到了同样的错误
  • 安装了 git 吗?
  • 如果你输入“git --version”会发生什么
  • 我不知道我应该先安装 git。我安装了它,它现在可以工作了。谢谢:)
  • 不客气
猜你喜欢
  • 2021-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-19
  • 1970-01-01
  • 1970-01-01
  • 2012-08-24
  • 1970-01-01
相关资源
最近更新 更多