SteGriff

Blog

Next & Previous

Make a TFVC Shelveset into a git commit

This post belongs in an earlier time, but I’m repatriating (read: burning) a load of old content from a work wiki and I thought some poor soul out there on the web might still need help with migrating from TFVC to git 🙏

Say you are trying to take a set of changes made to a TFVC/TFS repository and apply those changes to a git repository.

You could try and use tf diff /format:unified but it produces garbage. Here is another way:

Part 0. Have a shelveset targeting Main

To create a shelveset of changes that apply to $/MyProject/Main:

Part 1. TFS Shelveset into patch file

We are going to temporarily set up a git repo in the checked-out TFS folder just to allow us to generate a diff using git diff. Here we go:

Part 2. Apply patch file to git repo

Part 3. Repeating this for more changes/other branches