git push heroku master生成“没有更改”,但不识别本地更改?

2024-10-02 20:37:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在制作一个网站(django),我和heroku一起上传到网上。一切都很顺利,直到我不得不改变我的观点。 现在当我这样做的时候:

- git add .
- git commit -m "smtg"
- git push heroku master 

它告诉我,没有什么变化,但我做了一些改变,似乎它看不到这些。 当我尝试git init时,它告诉我“

Reinitialized existing Git repository in C:/Users/Loic/Documents/my_site2/.git/

" 你能帮我吗?这是一个学校项目。 多谢各位

编辑:现在在git推送heroku master之后,我有:

 To https://git.heroku.com/cleanpharmacycle.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/cleanpharmacycle.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Tags: thetoinhttpsgitmastercomheroku
1条回答
网友
1楼 · 发布于 2024-10-02 20:37:15

检查您当前的分支是否为主分支

 git branch 

如果指针没有指向主分支,则签出到主分支

git checkout master

git push heroku yourlocalbranch:master如果要将本地非主分支推送到heroku主分支

提交您的更改并尝试推送到heroku

git commit -am "xxxyyzzz"    
git push heroku master

相关问题 更多 >