git push branch to a new repo with a different name

后端 未结 1 1880
长情又很酷
长情又很酷 2020-12-29 10:46

How can I push a branch to a different repo with a new name for the branch.

For instance I have a branch feature1 on repo abc and I\'d like

相关标签:
1条回答
  • 2020-12-29 11:30

    I think this should work:

    git push xyz feature1:master
    

    If master already exists, you can clobber it with -f/--force, or +:

    git push -f xyz  feature1:master
    git push    xyz +feature1:master
    

    From the man page (in the examples section at the end):

       git push origin +dev:master
           Update the origin repository’s master branch with the dev branch,
           allowing non-fast-forward updates. [...]
    
    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题