需要用的工具: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管理的解決方案下複製一個到這個項目的根目錄,提交到
推送到代碼倉庫就可以了。