14

I am trying to clone a TFS repository using git-tfs.

It works great with TFS projects that don´t have a space in the name, such as:

git tfs clone http://tfs:8080/ $/TeamProject/folder

But I also have some projects/folders that has both spaces and swedish characters in it:

git tfs clone http://tfs:8080/ $/TeamProject/my swedish åäö folder1/folder2

When I run the command I get:

The item $/TeamProject/my swedish åäö folder1/folder2 does not exist at the spcified version.

Any suggestion how to fix this?

4
  • 7
    Try enclosing the whole path in double quotes.
    – Polynomial
    Commented Feb 7, 2012 at 9:31
  • That worked partly. I can now clone projects/folders with space, but still having issues with swedish characters
    – Zeno
    Commented Feb 7, 2012 at 9:42
  • 1
    You could try urlencoding them? I'm not sure how it handles such characters.
    – Polynomial
    Commented Feb 7, 2012 at 9:46
  • Im not even able to write swedish characters in the git bash console. Is it possible to change language?
    – Zeno
    Commented Feb 7, 2012 at 11:01

2 Answers 2

19

Here's a working example of cloning a TFS (TFVC) repository using git tfs where the TFS (TFVC) repository contains spaces:

git tfs clone http://tfs:8080/ $/"Team Project/Folder Name"

The key "trick" to making it work is to put the double quotes around the team project / folder name (but don't put them around the $/ part).

i.e. $/"Team Project/Folder Name"

5
  • Your answer doesn't make sense. Can you remember (and add) the context?
    – jpaugh
    Commented Sep 25, 2017 at 19:49
  • How does it not make sense? The original question was "How do I clone a tfs project that contains spaces" and I've provided an example of how to clone a tfs project that contains spaces e.g. $/"Team Project/Folder Name". Commented Sep 28, 2017 at 2:20
  • Your answer doesn't mention what's wrong, or even whether there is a way to fix it. (It is, in effect "Something about quotes.") This may seem nitpicky, but establishing credibility is just as important as having the right code there.
    – jpaugh
    Commented Sep 28, 2017 at 3:31
  • Much appreciated.
    – jpaugh
    Commented Oct 5, 2017 at 17:01
  • Awesome! Worked for me.
    – GET1NE
    Commented Dec 13, 2019 at 18:02
6

I solved the problem by renaming the projects in TFS, and removed the swedish characters.

As Polynomial said, it is possible to have folders/projects that contains space if you enclose the path with double quotes.

1
  • 1
    yes double quote should save you for space characters but the last version of git-tfs should now resolve your problem of swedish characters...
    – Philippe
    Commented Dec 6, 2012 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.