简体   繁体   中英

How to Push branch of one repository to a new branch in another repository?

I have a branch "tree" in my testing repository.

Now i want to move that branch to a new repository "react-tree-component" as the brand new master branch,

Testing > tree
MOVE TO
react-tree-component > master

Use Case : I have a testing repo in which I treat as rough work..but sometime the work turns out to be useful and can be a starting point of another project deserving its own repo....therefore need this

how can i do this?

You first need to add the new "target" remote:

git remote add react-tree-component <url>

And then push with rename:

git push -u react-tree-component tree:master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM