简体   繁体   English

无法使用Git Push Heroku Master推送本地更改

[英]Unable to push local changes live using Git Push Heroku Master

I'm new to GitHub and have gotten myself into a tangle. 我是GitHub的新手,让自己陷入困境。 I've been successfully deploying code to a Heroku / Django app. 我已成功将代码部署到Heroku / Django应用程序。 However, my last commit was unsuccessful. 但是,我上一次提交都没有成功。 This is my flow... 这是我的流程......

- Git add .
- Git commit -m "social media icons"
- Git push heroku master

The last command returns.... 最后一个命令返回....

Fetching repository, done.
Everything up-to-date

Everything is not up to date. 一切都不是最新的。 One thing I've discovered on my GitHub app is that I have 2 branches "production" and "master". 我在GitHub应用程序中发现的一件事是我有两个分支“生产”和“主”。 Master was last updated Sept 8th. 大师最后更新于9月8日。 I've run a few commands including "git pull origin master" and "git push -f" based on other Stack answers. 我根据其他Stack答案运行了一些命令,包括“git pull origin master”和“git push -f”。 The latter did seem to push something but not the changes in local. 后者确实似乎推动了一些东西,但没有推动当地的变化。 Sorry, I'm trying to find my feet here! 对不起,我想在这里找到我的脚!

If you're on production branch then you will need to do 如果您在生产分支上,那么您将需要这样做

git push heroku production:master

Heroku will only deploy the master branch so this command is you pushing your local production branch into the master branch on the remote. Heroku只会部署主分支,因此您可以将本地生产分支推送到远程主分支。

So you are on branch production but your other branch master is up to date. 所以你在分支机构生产,但你的其他分支机构是最新的。 If you want to push the current branch you are on, you should explicitly say so: git push heroku production . 如果你想推送当前的分支,你应该明确这样说: git push heroku production

I would highly advise you to try git , it's an excellent resource. 我强烈建议你尝试git ,这是一个很好的资源。

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

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