git remote 中同时有 heroku 和 origin (github) ,如何 git commit 到 github (目前自动 commit 到 heroku )?

2015 年 6 月 6 日
 DIJ
4783 次点击
所在节点    git
8 条回复
foccy
2015 年 6 月 6 日
git push origin branch 这样?

可以 google 一下。
likaci
2015 年 6 月 6 日
@foccy git push -u origin master 加个-u
--set-upstream
jokester
2015 年 6 月 6 日
先学会提问题
你不**commit**到远程repo
你**push**到远程repo
zts1993
2015 年 6 月 6 日
commit只要一次吧,应该是push两次,要不写个脚本。。。。
gowithwind
2015 年 6 月 6 日
帮你搜了下

git remote set-url origin --push --add user1@repo1
git remote set-url origin --push --add user2@repo2
git remote -v show
roychan
2015 年 6 月 6 日
git push origin master (branch)
julyclyde
2015 年 6 月 7 日
@zts1993 push两次应该是同一个行为啊,理论上不会第一次push一个remote,第二次push另一个,除非加参数。而lz问的就是:加什么参数
eastphoton
2015 年 6 月 7 日
commit 只需要一次提交到本地git仓库,你需要的是分别push到两家
git commit -m "can you Google before ask?"
git push origin master
git push heroku master
(master是branch名,如果不同自行修改)

如果你需要只输入git push就提交到heroku而不指定remote仓库名称,那么执行一次
git branch --set-upstream=heroku


提问之前请先搜索一下,这种简单问题最好不要浪费他人时间
http://www.beiww.com/doc/oss/smart-questions.html

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://v2ex.xtra.eu.org/t/196474

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX