Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to create a tfs branch with git-tfs?


Asked by Kieran Hancock on Dec 13, 2021 Git



You have first to checkout a commit corresponding to a tfs changeset already check in. Once done, you just have to create a branch with the command: Git-tfs will create a branch on TFS with the path "$/Repository/ProjectBranchToCreate" where the first changeset comment will be "Creation of my branch".
In addition,
Cloning from TFS –with-branches. Working with the master branch of git-tfs from github you now have the ability to clone several TFS branches into local git branches. prompt> git tfs clone --with-branches http://tfsserverurl:8080/tfs/ $/Project/Folder/ pathToLocalRepo. This will: initialize a local git repo;
Consequently, When you are ready to check in your work in tfs, just checkout your local branch then use the command: The tfs branch will be created and all the git commits in the local branch will be checked in the Tfs branch \o/ This command will only rename the local remote and will not rename the branch in TFS.
Additionally,
Unlike Git branches, which are repository scoped, TFVC branches are path scoped and not as lightweight. Set your bar for creating branches high and only branch when you have a need for code or release isolation.
Similarly,
Branching in TFS — How Does it Work Branching in TFVC uses path-based branches that create a folder structure. When you create a branch, you define a source, usually the main folder, and a target. Then files from the main folder are copied into your branch.