简体   繁体   English

TFVC复制到本地git

[英]TFVC replicate into local git

I am actually facing a small issue at work. 我实际上在工作中面临一个小问题。 We are using TFVC with a Dev and Prod branches. 我们正在将TFVC与Dev和Prod分支一起使用。 We only commit changes to the Dev branch once the new feature is finished and fully tested (there's not possibility to have a separate branch per feature, nor to migrate this project to Git). 只有在新功能完成并经过全面测试后,我们才将更改提交到Dev分支(不可能为每个功能创建单独的分支,也无法将此项目迁移到Git)。

I need to be able to compare the work i did today with the one from yesterday. 我需要能够将我今天所做的工作与昨天所做的工作进行比较。 There's the shelveset option (via the compare shelveset plugin, but it doesn't work quite well with VS2015). 有racketset选项(通过compare racket插件,但是在VS2015中效果不佳)。

So the other option I can see is to copy the files flagged as "modifed by" from my workspace into another local git repo, so i can do a daily commit for example. 因此,我可以看到的另一种选择是将标记为“由...修改”的文件从我的工作区复制到另一个本地git repo,这样我就可以进行每日提交。

Any other ideas? 还有其他想法吗?

Thanks ! 谢谢 !

Any other ideas? 还有其他想法吗?

Use https://github.com/git-tfs/git-tfs 使用https://github.com/git-tfs/git-tfs

Once the repository cloned with something like (it's better to choose a changeset common between Dev and Prod branches): 一旦使用类似的方式克隆了存储库(最好选择DevProd分支之间通用的变更集):

https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md#clone-from-a-specific-changeset https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md#clone-from-a-specific-changeset

you just have to do a pull every times: 您只需每次都做一次拉:

git tfs pull --rebase

Then you could compare your commits. 然后,您可以比较您的提交。

I ended up creating a small script that: 我最终创建了一个小脚本:

  1. copies the modified files since xx date from my local TFS repo to a local git repo. 将自xx日期以来的修改文件从我的本地TFS存储库复制到本地git存储库。
  2. Use libgit2sharp to commit the changes 使用libgit2sharp提交更改
  3. Use GitK to review the history 使用GitK查看历史

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

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