Git to TFS Migration Experiment: Part 2

July 20, 2014

Git: Learning, Nerd, TFS

Connecting a Git Repo to a New TFS Repo

I was testing with VisualStudioOnline, soooo….

2a. I had to enable basic auth for my Visual Studio Online Account:

To work with Visual Studio online from the Git Command prompt, you must Enable basic authentication for your Visual Studio Online account.

This forces you to enter your username/password EVERY SINGLE TIME you push or pull using git-tf.

TIP:
You can set it in your global config like this:
git config --global git-tf.server.username YourUsername git config --global git-tf.server.username YourPassword
The –global switch prevents it from being stored in the project’s .gitconfig, but be aware that this will add it, in plain text, to your global config file (which lives in C:\Users\YourId\.gitconfig).

globalgitconfiggtfserver


2b – Take 1:
Configuring GIT-TFS:

I originally thought “git tfs init” was intended to create a new TFS repo.
Nope.
gittfsinitmeme2

The init command creates a new git repository, initialized from a TFS source tree (without fetching the changesets). Fetching changeset should be done with fetch command. Prefer the clone command to init and fetch changesets from a TFS repository!I could not find a way to create a new TFS repo & push an existing git repo up to it, solely using the git-tfs bridge.


2b – Take 2
:
Configuring GIT-TF:

> git tf configure https://coridrew.visualstudio.com/DefaultCollection/ $/libgit2sharp/Main –deep

What did that do?

It just added this to .git/config:

image_thumb2_thumb1_thumb(Interesting, I would have assumed the depth var would be a bool):

2b – Note: Adding the /Main folder to the path was necessary (although you could name it anything you want) because when TFS created the project folder, it was not empty:
image_thumb18
This will also be mentioned in the troubleshooting section of my next post in this series about pushing to TFS.

Trackbacks/Pingbacks

  1. Git to TFS Migration Experiment: Part 3 | Truncated CoDr's Blog - July 20, 2014

    […] project folder is not empty. See 2b – Note, in Part 2. You can re-run git tf configure to update the […]

  2. Dew Drop – July 21, 2014 (#1818) | Morning Dew - July 21, 2014

    […] to TFS Migration Experiment: Part 1 and Git to TFS Migration Experiment: Part 2 and Git to TFS Migration Experiment: Part 3 (Cori […]

  3. Reading Notes 2014-07-28 | Matricis - July 28, 2014

    […] to TFS Migration Experiment: Part 1 – Get all the tools you need to move. Part 2, Part 3 – Last post of the series, focuses on the […]

  4. Git to TFS Migration Experiment: Conclusion | Truncated CoDr's Blog - August 28, 2014

    […] Part 2 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: