Can I map local branches to remote branches with different prefixes in git?

前端 未结 4 864
我寻月下人不归
我寻月下人不归 2021-02-13 19:01

We\'re working with a semi-centralized git repository here where I work. Each developer has their own subtree in the central git repository, so it looks something like this:

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-13 19:20

    You can map your branch to different tracking branch on the remote with something like this:

    git remote add heroku git@heroku.com:YOURAPPNAME.git
    git checkout -b heroku -t heroku/master
    

    Your config ends up similar to what @Paul suggests (a tad "simpler" actually).

    See this gist (with tweaks by me) for usage steps that work well for me https://gist.github.com/2002048.

提交回复
热议问题