2

I have cloned my TFVC from VSTS and it pulled all my branches without any errors. I then followed a number of online posts that said to cleanup my projects by doing the following:

  1. Remove the GlobalSection(TeamFundationVersionControl) section from solution files
  2. remove all *.vssscc files
  3. Remove all *.vspscc files

When I do this I get almost all of my files showing up in the Changes window under Team Explorer. All of these files have no changes when doing a diff except for the files discussed earlier.

What is the proper way to cleanup branches after doing the clone from TFVC to git?

Thanks

user1522446
  • 256
  • 3
  • 13
  • Which post did you refer to? Why did you remove files? What did you want to achieve? – Cece Dong - MSFT Oct 17 '16 at 08:09
  • I wanted to clone my TFVC from VSTS. This worked correctly with git-tfs. In the following link http://donaldonsoftware.azurewebsites.net/2016/02/Migrate-from-TFVC-to-Git-in-TFS-with-Full-History/ it says to do some cleanup after the clone. – user1522446 Oct 17 '16 at 13:38

2 Answers2

2

If you want to migrate an existing TFVC repos to Git repos, you can use the git-tfs tool, which allows you to migrate a TFVC repo to a Git repo in just a couple of commands.

In my example, with the commands below, I have successfully migrated an existing TFVC repo to Git repo with all branches.

enter image description here

enter image description here

If you don't want to clone the branches, you can specify --branches=VALUE (VALUE=none|auto|all), check https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • I did not have any problems cloning. I was asking a question on what do after the clone to cleanup the files and remove all info related to TFVC – user1522446 Oct 17 '16 at 13:41
0

When I do this I get almost all of my files showing up in the Changes window under Team Explorer. All of these files have no changes when doing a diff

That should be due to a bad end of line setting...

except for the files discussed earlier.

First commit them...

Then fix your setting.

You've got 2 options (not mutualy exclusive, you could do the 2. But if you do only one, do the 2nd) :

  • (old style), set the git core.autocrlf setting. On windows, that's either true to convert all file to a windows eol style or false to tell git to not touch the files. It's a matter of choice. This settings will be used for ALL your repositories but will be personal
  • (new one recommended) Add a .gitattributes files to telle git how to handle eol for all type of files. This settings will be used for this repository only but will be shared by all the developpers and noone won't be able to commit bad files.

Be aware that for all the strategies that you will try, to be sure that it works, you will have to do soemthing special. You will have to wipe all the files and checkout them all from the repository (because that's at this special moment that git modify the files):

git checkout .

There is a possibility that in fact, the files are modified because they have been checkouted in the format you wish, so commmit them all (you will be obliged) and apply the eol strategy, just after...

A good doc on the subject that you should read carefully and understand before trying something...

PS: handling end of line is not an easy task in a git repository and it will take you quite some time and you will have to try a lot of things before really understanding how it works ( I'm not pretty sure myself ;) )

Philippe
  • 28,207
  • 6
  • 54
  • 78