git-tfs and msysgit on Windows 7

6

2

I've installed msysgit [msysGit-fullinstall-1.7.4-preview20110204.exe] on Windows 7 64-bit, and extracted git-tfs [GitTfs-0.11.0.zip] into a directory on my machine.

I've setup both the msysgit installation directory (e.g. C:\software\msysgit\msysgit) on the PATH as well as the directory to which I extracted git-tfs (e.g. C:\software\GitTfs-0.11.0).

I run msys, and then attempt to run git tfs but I receive the error:

git: 'tfs' is not a git command. See 'git --help'.

According to https://github.com/spraints/git-tfs/wiki this should be possible.

What have I missed? Just running git-tfs from the command line (cmd) doesn't work either.

Thanks,

James

jamiebarrow

Posted 2011-06-07T07:10:13.967

Reputation: 166

1When running git-tfs by itself on the command line, I get the error 'The system cannot find the file specified' while attempting a clone, so I assume something isn't setup right. – jamiebarrow – 2011-06-07T07:40:49.317

Answers

6

It seems that whitespace anywhere in the PATH variable causes git to freak out and ignore all the paths after that. Adding the path to your tfs directory at the start of the PATH variable should solve it.

Examples using the bash prompt that comes with msysgit

PATH=$PATH:/C/software/GitTfs-0.11.0

did not work

PATH=/C/software/GitTfs-0.11.0:$PATH

worked fine for me.

Paxxi

Posted 2011-06-07T07:10:13.967

Reputation: 6 952

Hi Pär, did you set this path in the current session or in a batch file? I tried exporting the PATH variable as you suggested (with the git tfs path coming first) but it wasn't picked up then and there - is there a command to run that re-load's msysgit's knowledge of commands on the path? I added it to set the path as the first line of msys.bat, and that works for me now, thanks :) Is there a specific file I should be customizing the PATH in? – jamiebarrow – 2011-06-08T10:46:04.913

It shouldn't matter when or where you set the path as long as it's done before you call git tfs. Once you've set the PATH it should be permanent and be there for all sessions until you actively remove it. – Paxxi – 2011-06-08T12:10:13.900

0

Looking at the content of a GitTfs-0.11.0.zip, I see it contains a git-tfs.exe.
That means git tfs won't work, only git-tfs.

If you have added C:\software\GitTfs-0.11.0 to your PATH (in the environment variables), this should work, provided you open a new DOS session, in order to inherit that new PATH.

VonC

Posted 2011-06-07T07:10:13.967

Reputation: 13 292

If you read https://github.com/spraints/git-tfs/wiki, then it wouldn't appear to be so?

– jamiebarrow – 2011-06-07T07:36:24.697

Plus, I've already said I added it to my PATH. I tried using the command by itself (not through msysgit), but also came into a different issue, as stated in the original post. – jamiebarrow – 2011-06-07T07:37:02.013

@jamiebarrow: so in a new DOS session, you can do an echo %PATH% and see the right path for git-tfs.exe? – VonC – 2011-06-07T07:40:07.613

Yes. And in msys, I can do env|grep GitTfs and it also shows it on the PATH – jamiebarrow – 2011-06-07T07:41:44.807

As mentioned, I can run git-tfs (where I said "Just running git-tfs from the command line"), added a comment to explain what I get when attempting to clone a repository. – jamiebarrow – 2011-06-07T07:42:40.097

@jamiebarrow: ok, I didn't see the comment at first. Did you try only on a msys bash session or in a DOS session? Or both? In a DOS session, do you have HOME set? (in case it has any bearing) – VonC – 2011-06-07T07:50:42.163

@jamieborrow: even if the thread has nothing to do with git tfs, it illustrates that this kind of error could be related to a .Net4 installation issue: http://www.codeproject.com/KB/aspnet/ZetaResourceEditor.aspx?msg=3559812

– VonC – 2011-06-07T07:53:47.233

@VonC I don't see how that post is related at all, and don't have time to read through it all... have you used msysgit or git-tfs...? – jamiebarrow – 2011-06-07T09:27:45.783

@jamiebarrow: it was only to mention that the GitHub page of git-tfs mentions "You need .NET 4 and either the 2008 or 2010 version of Team Explorer installed". It is possible that your error message comes from one of those prerequisites missing or not in the PATH somehow. I haven't used git tfs directly, I know msysgit well (http://superuser.com/search?q=user:141+%5Bmsysgit] or http://stackoverflow.com/search?q=user:6309+%5Bmsysgit]

– VonC – 2011-06-07T10:22:54.450

@VonC Thanks for your help, but no, nothing to do with .NET or TFS related setup. Pär found that the ordering of the PATH could be the issue (perhaps part of the PATH is invalid and doesn't get processed by msysgit), so I used the path to git-tfs as the first item [ well, close to first :) ] – jamiebarrow – 2011-06-08T12:04:30.813

-1

The steps below worked for me:

  1. Download GitTfs zip and unblock downloaded files (right click each file->properties->click unblock
  2. Copy files to Git folder (for me C:\Program Files (x86)\Git\bin) (I've 15 files)
  3. Now the git tfs command should work.

Manish Jain

Posted 2011-06-07T07:10:13.967

Reputation: 101

That will probably work. But doesn't allow me to have a custom path to where I install my different utilities etc. Not useful answer. – jamiebarrow – 2012-02-07T09:36:46.213