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 · 4730 views
    This topic created in 3999 days ago, the information mentioned may be changed or developed.
    8 replies    2015-06-07 18:00:25 +08:00
    foccy
        1
    foccy  
       Jun 6, 2015
    git push origin branch 这样?

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

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