繁体   English   中英

Git:将现有仓库复制到新分支

[英]Git: Copy existing repo to new branch

我需要将现有的git存储库复制到我尝试过的现有git存储库上的新分支

git branch new_branch
git checkout new_branch
git remote add project url/to/existing/repo
git fetch

但这不起作用,我需要保留提交历史记录:)

因此,您只想从回购中获取所有内容? 去做。

git remote add existing url/to/existing/repo
git fetch existing

然后为您关心的任何事情添加跟踪分支。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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