git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
DIJ
V2EX  ›  git

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

  •  
  •   DIJ · Jun 6, 2015 · 5157 views
    This topic created in 4170 days ago, the information mentioned may be changed or developed.
    8 replies  •  2015-06-07 18:00:25 +08:00
    foccy
    foccy
    Jun 6, 2015
    1
    git push origin branch 这样?

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

    git remote set-url origin --push --add user1@repo1
    git remote set-url origin --push --add user2@repo2
    git remote -v show
    roychan
    roychan
    Jun 6, 2015
    6
    git push origin master (branch)
    julyclyde
    julyclyde
    Jun 7, 2015
    7
    @zts1993 push两次应该是同一个行为啊,理论上不会第一次push一个remote,第二次push另一个,除非加参数。而lz问的就是:加什么参数
    eastphoton
    eastphoton
    Jun 7, 2015
    8
    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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1321 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 20:24 · PVG 04:24 · LAX 12:24 · JFK 15:24
    ♥ Do have faith in what you're doing.