Friday, November 11, 2016

Creating Git repository on MS Team Fondation Server

Another note to self.

I was new to Git, so looked for an easy-to-follow instruction such as this one: http://rogerdudler.github.io/git-guide/.

Though the above does not talk about it, first you need to create the repository itself, in case you do not have one. I did not have one, so created one on TFS, and uploaded (“pushed”) the set of files that I want to version-control.

This tells you how to create a team project: https://blogs.msdn.microsoft.com/visualstudioalm/2013/01/30/getting-started-with-git-in-visual-studio-and-team-foundation-service/. You do so on Visual Studio. Though it does not say (I did not find it saying), I believe a team project configured to use Git is a remote master repository of Git.

First, I have cloned the empty repository onto my PC, and added the files that I want to version-control from now on.

Then issued these commands.

- git add *

- git commit -m "Commit message"

They resister and commit my files to the cloned local repository. Now my files are ready to be copied (“pushed”) to TFS, with the following command.

- git push origin master

This pushes the contents of my master branch to the remote repo, the origin (I think this is because the local repo has been cloned from it).

Now, my files are under Git version control. I can checkout, that is, clone them and start modifying in other IDEs which support Git, suh as AndroidStudio and Xcode.