需要用的工具:1、Chocolatey windows下的一个包管理器,这个可以管理window软件
2、git-tfs 迁移工具。用Chocolatey来安装。也可以去github下载
步骤:
1、安装Chocolatey:
在cmd命令行运行:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
2.然后安装git-tfs(cmd运行)
cinst GitTfs
3、创建git项目 文件夹:
4、克隆项目 :
git tfs clone -u=USER http://tfs:8080/tfs/DefaultCollection $/ProjectName
说明:git tfs clone -u=USER http://tfs:8080/tfs/团队 $/项目名
5、在git服务器建好对应的仓库,推送上去。
6、这里用VS2017提交代码可能会出错。
这是因为没有加git 的忽略文件.gitignore ,去别的用git管理的解决方案下复制一个到这个项目的根目录,提交到
推送到代码仓库就可以了。