使用所有历史将 Git 迁移到 TFS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20757043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Migrate Git to TFS with all history
提问by ehsandotnet
Is there any way to migrate a git repository to TFS with all it's history like versions, branches and push messages? Now the source is on Github and I want to migrate that to my local TFS repository.
有什么方法可以将 git 存储库迁移到 TFS 及其所有历史记录,如版本、分支和推送消息?现在源在 Github 上,我想将其迁移到我的本地 TFS 存储库。
回答by jessehouwing
The Branches in TFS are mapped to folders, which doesn't easily convert from the way branches work in Git. Grabbing one branch and pushing that, with history to TFS should be possible though. You'll have to use Git tf checkin --deep
TFS 中的分支映射到文件夹,这不容易从 Git 中的分支工作方式转换。抓住一个分支并将其推送到 TFS 应该是可能的。你必须使用Git tf checkin --deep
See:
看:
If you want to migrate to TFS the easiest migration path is to TFS 2013 or Visual Studio Online, which has native Git support.
如果您想迁移到 TFS,最简单的迁移路径是 TFS 2013 或 Visual Studio Online,它们具有本机 Git 支持。
回答by mzagozda
Install git-tffrom Codeplex source, MS Downloads, or better yet:
从 Codeplex 源、 MS 下载或更好的地方安装git-tf:
- Chocolatey Package:
choco install git-tf
- 巧克力包装:
choco install git-tf
Then run the following commands:
然后运行以下命令:
First you need to configure your GIT repository
git tf configure http://yourserver.com:8080/tfs/DefaultCollection $/RepositoryName
Check in the files, optionally persisting author/USERMAP:
git tf checkin --deep --autosquash --keep-author
首先你需要配置你的 GIT 仓库
git tf configure http://yourserver.com:8080/tfs/DefaultCollection $/RepositoryName
签入文件,可选择保留作者/USERMAP:
git tf checkin --deep --autosquash --keep-author
This process is very slow, but it works, so ensure you have plenty of time to spend migrating. The only downside is that commit time will be the current checkin time, not the original changeset time.
此过程非常缓慢,但有效,因此请确保您有足够的时间用于迁移。唯一的缺点是提交时间将是当前签入时间,而不是原始变更集时间。