I am using Team Foundation Server with git source control repository. I would like to be able to name branches with the / character separating words like, "dev/feat/button". Git supports this however the TFS build system runs into a problem with the /'s being in the name. It properly creates the directories but runs into a problem cleaning the directory because it thinks the entire "dev/feat/button" is a file and not a nested set of directories. Has anyone been able to get this to work?
Asked
Active
Viewed 1,027 times
2 Answers
1
As illustrated by git-tfs, you cannot use a '/' in a TFS branch name, since TFS has this notion of branch path:
A <- B <- C <- D <- E $/Repository/ProjectTrunk
\
M <- N $/Repository/ProjectBranch
That is very different from Git, for which a branch is just a set of commits in a graph.

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
that link your provided is for tfs source control not git. That does not apply to the git source control within tfs. I can create a branch name in git with a / in it. The only thing that fails is the build scripts when trying to clean the workspace. It thinks that the / is part of the file name and not a directory. – Brandt Feb 21 '17 at 21:15
-
@Brandt I agree: my point was to reference TFS, and yes, Git does support '/' (as a naming convention for branch namespace: http://stackoverflow.com/a/2527436/6309, http://stackoverflow.com/a/6065944/6309). – VonC Feb 21 '17 at 21:19
1
I've tested in TFS 2015.3 by creating a branch with name dev/test
:
Then in TFS build, select this branch:
TFS build can get this branch without issue:

Cece Dong - MSFT
- 29,631
- 1
- 24
- 39