git-tfs: How do I clone a tfs project that contains spaces
Asked Answered
P

2

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?

Parisi answered 7/2, 2012 at 9:29 Comment(4)
Try enclosing the whole path in double quotes.Mamey
That worked partly. I can now clone projects/folders with space, but still having issues with swedish charactersParisi
You could try urlencoding them? I'm not sure how it handles such characters.Mamey
Im not even able to write swedish characters in the git bash console. Is it possible to change language?Parisi
P
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.

Parisi answered 8/2, 2012 at 18:31 Comment(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...Stepheniestephens
G
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"

Gingivitis answered 12/4, 2016 at 22:29 Comment(5)
Your answer doesn't make sense. Can you remember (and add) the context?Cracknel
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".Gingivitis
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.Cracknel
Much appreciated.Cracknel
Awesome! Worked for me.Homestead
P
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.

Parisi answered 8/2, 2012 at 18:31 Comment(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...Stepheniestephens

© 2022 - 2024 — McMap. All rights reserved.