-
Notifications
You must be signed in to change notification settings - Fork 0
Init branch
The init-branch
command creates a git branch for an existing TFS branch (or all) and fetch all the changeset of the TFS branch.
To use this command, you should have cloned only the trunk folder in TFS (and not the whole repository). See clone command.
Usage: git-tfs init-branch [$/Repository/path <git-branch-name-wished>|--all]
-h, -H, --help
-V, --version
-d, --debug Show debug output about everything git-tfs does
--all Clone all the TFS branches (For TFS 2010 and
later)
-b, --tfs-parent-branch=VALUE
TFS Parent branch of the TFS branch to clone
(TFS 2008 only! And required!!) ex: $/Repository/ProjectParentBranch
-u, --username=VALUE TFS username
-p, --password=VALUE TFS password
Suppose you have on TFS:
A <- B <- C <- D <- E $/Repository/ProjectTrunk
\
M <- N $/Repository/ProjectBranch
You should have done (to clone only the trunk) :
git tfs clone http://tfs:8080/tfs/DefaultCollection $/Repository/ProjectTrunk
Then use init-branch
like this :
git tfs init-branch $/Repository/ProjectBranch
git tfs init-branch $/Repository/ProjectBranch myNewBranch
git tfs init-branch --all
This command init all the branches not already done and ignore existing ones.
TFS2008 doesn't permit to know the parent of a branch. You should find it yourself with TFS and use the parameter --tfs-parent-branch
to give it to the init-branch
command:
git tfs init-branch --tfs-parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch
For the use of parameters --username
and --password
, see the clone command.
For the use of parameter --authors
, see the clone command.
After that your branch is created, you should use the commands fetch and checkin or rcheckin with the parameter -i
to work with the TFS branch.