问题描述
我正在尝试针对Google Colab上的Torch使用自定义的安装脚本。
此代码遇到问题:
#!/usr/bin/env bash
git fetch
git reset --hard
# Submodule update is done inside install.sh
/root/torch/install.sh -s
Colab将其报告给git命令:
致命:不是git存储库(或任何父目录):.git
解决方法
fatal: not a git repository (or any of the parent directories): .git
表示您试图运行Git命令,但不在Git存储库中。
第一个命令git fetch
将从一个或多个其他存储库中获取分支和/或标签,因此该脚本应放在git存储库中。
确保您在git仓库中,执行git status
或git remote -v
来检查您是否在仓库文件夹中。
您可以使用!
或%%shell
单元格中的!pwd
或!git status
在Colab中调用Shell命令