How to clone something?

May 5, 2014 at 2:16 PM
I don't know much about TFS except that it's painful to work with and causes trouble sometimes because of lost updates and failed connections. Then someone experienced has to clean up the mess and manually synchronise/merge all the different versions.

Now I came across this little helper. I thought that it would at least ease the usage of version control on my side, allowing me to use a more familiar version control system and toolset. Reading the home page didn't help me much, so I downloaded it and tried it out. After a few error messages, I'm now at the point where git-tf actually tries to do something. but it says it "could not find a valid TFS Collection at" the URL I provided.

Again, the documentation is missing here. I've tried with the host name that I entered in the TFS connection dialog in Visual Studio. That's just a host name, no http or something. Then I put "http://" in front of it. That doesn't work. The one example includes a port number, other threads mention a path on that web server. How do I know what to enter here? Visual Studio can connect with just the host name, git-tf does not. Is it broken? Or not smart enough?

It would be very helpful if there were an actual explanation of the parameters I must specify and what they mean. My guesswork wasn't successful and now I'm stuck.
May 6, 2014 at 8:29 AM
Edited May 6, 2014 at 8:35 AM
Hi!

For the value of [<projectcollection>] in case of the TFS 2013 (not sure about previous versions) I use the same URL as for opening it in the web browser.

Simple way to checkout
$ git tf clone http://tfs:8080/tfs/DefaultCollection $/Prg/Branch
More complex example in case there are some network connection issues
$ git init somedir
$ cd somedir
$ git tf configure --deep --no-metadata http://tfs:8080/tfs/DefaultCollection $/Prj/Branch
$ git tf pull
in case of broken connection, there is way to continue right after failed pull:
$ git tf fetch # repeat fetch cmd untill success
$ git checkout -b master remotes/origin_tfs/tfs
  • --deep flag required to fetch all of the branch history on the initial clone and next pull's. May abuse TFS server
  • --no-metadata allows to not confuse other regular TFS users with git commit IDs
Hope this will help
Jun 4, 2014 at 12:30 PM
Iam not quite sure at TFS or git, would say a newbie.
We have a server in location 1 which is TFS 2012 and new set of server for fault tolerance recently installed in location 2 and is of TFS 2012
I need now copy the source code of one project from location 1 to location 2.

Would appreciate if this could be done using git, if so please paste the syntax.