如何将分支从一个存储库移动到不同存储库的另一个分支 [英] How to move branch from one repository to another branch of different repository
本文介绍了如何将分支从一个存储库移动到不同存储库的另一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用现有的存储库(命名为 repoE)创建了一个新的存储库(命名为 repoN),只需从分支(命名为 B22)复制代码即可.
I created a new Repository (named repoN) with the existing one (named repoE), simply by copying code from the branch (named B22).
之后,我在 repoN 中创建了一个新分支(名为 BR01).现在我对 repoN 存储库中存在的分支(名为 BR01)进行了一些更改.
After that, I created a new branch in repoN (named BR01). Now I made some changes in the branch (named BR01) which exist in repoN repository.
我只想将所有这些更改放入旧存储库 repoE 中,而不会丢失 BR01 到 B22 的历史记录.
I just want to take all those changes into the old repository repoE without loosing history of BR01 into B22.
我使用 SourceTree 是因为我是 Git 新手并且不知道很多命令.
I am using SourceTree because I'm new in Git and don't know much commands.
推荐答案
- 站在您要从中推送的当前存储库
- 签出要推送的分支
git remote add repoRemote https://bitbucket/repo/repo1.git
git push repoRemote
-- 将你当前的分支推送到你在 #3 中添加的远程仓库
- stand on your current repo you want to push from
- checkout the branch you want to push
git remote add repoRemote https://bitbucket/repo/repo1.git
git push repoRemote
-- will push your current branch to the remote repo you added in #3
这篇关于如何将分支从一个存储库移动到不同存储库的另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文