简体   繁体   English

git push heroku master 产生“没有任何变化”但不识别本地变化?

[英]git push heroku master yields 'nothing changed' but doesnt recognize local changes?

I am working on a website (django) that I uploaded online with heroku.我正在使用 heroku 在线上传的网站(django)上工作。 Everything worked fine until I had to make a change in my views.py.一切都很好,直到我不得不改变我的views.py。 Now when I do:现在当我这样做时:

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

It tells me that nothing change but I made some changes, it seems like it cannot see those.它告诉我没有任何改变,但我做了一些改变,似乎它看不到那些。 When I try git init it tells me "当我尝试 git init 它告诉我“

Reinitialized existing Git repository in C:/Users/Loic/Documents/my_site2/.git/重新初始化 C:/Users/Loic/Documents/my_site2/.git/ 中的现有 Git 存储库

" Could you please help me it is a school project. Thank you “你能帮我吗这是一个学校项目。谢谢

EDIT: now after git push heroku master I have:编辑:现在在 git 推 heroku 主人之后,我有:

 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.

Check your current branch is master.检查您当前的分支是主分支。

 git branch 

If the pointer is not pointing the master, then check out to master branch如果指针不指向主分支,则检查到主分支

git checkout master

git push heroku yourlocalbranch:master if you want to push your local, non master branch to heroku master git push heroku yourlocalbranch:master如果你想将本地非 master 分支推送到 heroku master

Commit your changes and try to push to heroku提交您的更改并尝试推送到 heroku

git commit -am "xxxyyzzz"    
git push heroku master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM