Cloning the source using below link
http://cakebuild.net/api/Cake.Git/GitAliases/2ACDDC0F
GitClone("https://github.com/cake-build/cake.git",
"c:/temp/cake",
"username",
"password",
new GitCloneSettings{ BranchName = "development" });
It works for cloning the branch source.
When i use the tag name(tags/12.4.2.1) instead of branchName facing the below issue
reference 'refs/remotes/origin/tags/12.4.2.1' not found
Note: tags/12.4.2.1 is exist
As a starting point, for the moment found only workaround, to execute git clone specific tag commands through cmd StartProcess