这是完整的cmd:
C:\Users\twori\Desktop\development\python\discord.py>git push heroku master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_a16c861c/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-622q7g33
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-622q7g33
remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
remote: Running command git checkout -q rewrite
remote: error: pathspec 'rewrite' did not match any file(s) known to git.
remote: ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to discord-gut.
remote:
To https://git.heroku.com/discord-gut.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/discord-gut.git'
老实说,我对GIT一无所知,但我只是搜索了此错误并尝试了所有方法。
请告诉我这是怎么回事。
+)我发现了这个:https://help.heroku.com/O0EXQZTA/how-do-i-switch-branches-from-master-to-main
并且我尝试了,但是得到了相同的结果:
C:\Users\twori\Desktop\development\python\discord.py>git push heroku main
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 683 bytes | 227.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.11
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_0ed9bf17/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-bii5i34v
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-bii5i34v
remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
remote: Running command git checkout -q rewrite
remote: error: pathspec 'rewrite' did not match any file(s) known to git.
remote: ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to discord-gut.
remote:
To https://git.heroku.com/discord-gut.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/discord-gut.git'
答案 0 :(得分:0)
remote: Collecting git+https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_a16c861c/requirements.txt (line 1))
remote: Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-622q7g33
remote: Running command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-622q7g33
remote: WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
remote: Running command git checkout -q rewrite
remote: error: pathspec 'rewrite' did not match any file(s) known to git.
它试图找到重写分支,但找不到它。重写git分支不再存在,现在是主要分支。
在您的requirements.txt
中,有以下一行:
git+https://github.com/Rapptz/discord.py@rewrite
将其更改为discord.py
或discord.py==1.3.4