Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
因为我的不和谐机器人而与heroku和git有麻烦_Git_Heroku - Fatal编程技术网

因为我的不和谐机器人而与heroku和git有麻烦

因为我的不和谐机器人而与heroku和git有麻烦,git,heroku,Git,Heroku,因此,我遵循本教程:我得到了以下错误: C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>git add . warning: LF will be replaced by CRLF in MyPythonFolder/Discord/.idea/inspectionProfiles/Project_Default.xml. The file will have its original line endings

因此,我遵循本教程:我得到了以下错误:

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>git add .
warning: LF will be replaced by CRLF in MyPythonFolder/Discord/.idea/inspectionProfiles/Project_Default.xml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in MyPythonFolder/Discord/.idea/inspectionProfiles/profiles_settings.xml.
The file will have its original line endings in your working directory
error: 'MyPythonFolder/Discord/among-us-bot1234/' does not have a commit checked out
fatal: adding files failed
在我运行代码之后:

git add .
这是我的完整cmd:

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/fa74f932-feb1-48cc-af29-1ab8f995ff9f?requestor=SFMyNTY.g2gDbQAAAAw2OC4xOTYuODMuOTVuBgC2ut1PdgFiAAFRgA.KdgYZdPy5IkEVNVbkS1q23B2LkB-Jo93XT9vBCojPvs
Logging in... done
Logged in as pytthon.joshua@gmail.com

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>heroku git:clone -a among-us-bot1234
fatal: destination path 'among-us-bot1234' already exists and is not an empty directory.

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>heroku git:clone -a among-us-bot1234
Cloning into 'among-us-bot1234'...
warning: You appear to have cloned an empty repository.

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>git add .
warning: LF will be replaced by CRLF in MyPythonFolder/Discord/.idea/inspectionProfiles/Project_Default.xml.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in MyPythonFolder/Discord/.idea/inspectionProfiles/profiles_settings.xml.
The file will have its original line endings in your working directory
error: 'MyPythonFolder/Discord/among-us-bot1234/' does not have a commit checked out
fatal: adding files failed

任何帮助都将不胜感激

让我们逐一分析您的错误:

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>heroku git:clone -a among-us-bot1234
fatal: destination path 'among-us-bot1234' already exists and is not an empty directory.
您正在一个非空目录中进行克隆。这是个坏主意:将存储库克隆到一个新的空文件夹中。Git无论如何都不允许您在该目录中进行克隆

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>heroku git:clone -a among-us-bot1234
Cloning into 'among-us-bot1234'...
warning: You appear to have cloned an empty repository.
我假设您删除了您的文件夹
并克隆到其中。现在文件夹为空,克隆将成功完成。但是,远程存储库是空的:其中没有文件

C:\Users\Joshua\OneDrive\VscodePrograms\MyPythonFolder\Discord>git add .
[...]
error: 'MyPythonFolder/Discord/among-us-bot1234/' does not have a commit checked out
fatal: adding files failed
让我们暂且不去理会在线上的警告,它们是无关紧要的。这个问题在另一个问题中被广泛讨论。其要点是:不要在非empy文件夹中进行克隆。例如,如果最终使用嵌套的
.git
文件夹,也就是说,使用嵌套的本地git存储库,则可能会出现此错误

返回到教程,按照它进行操作,但克隆到一个空的本地文件夹中。如果该文件夹不存在,Git将为您创建该文件夹。您的本地文件夹不必与存储库共享相同的名称


您有嵌套的git存储库吗?有<代码>C:\Users\\OneDrive\VscodePrograms\MyPythonFolder\Discord
似乎是git存储库(一个存储库的根或子文件夹)。您在
[…]\Discord\interen-us-bot1234
中克隆了其中的某些内容。您现在有多个嵌套的git存储库,这是需要管理的。在您的情况下,请不要在现有存储库中进行克隆。

谢谢,但现在我有另一个错误,因此我将就此提出另一个问题