I am using batch to check in to TFS.
Currently, I am using the following line:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe" checkin /noprompt /login:%un%,%pass% /comment:%1
How can I specify to only check in files to a specific branch?
Assume the branch name comes as input in %4.
The tf.exe checkin
command do checkin to your Pending Changes. if your changes are from specific branch so the checkin will be to this branch. you can't modify file in Branch a
and do checkin to Branch b
, you need to work on the file in Branch b
to be able checkin back the changes.
You can copy the modified file/s and paste them in Branch b
workspace, then do checkin.
If you want to checkin only one file, you can simply specify the file:
checkin c:/test.cs /noprompt ...
If you want to checkin only to specific branch (or location in the source control), just specify the server location:
checkin $/Project/Test/BranchA/* /noprompt ...
In your case:
checkin %4 /noprompt ...
PS - the %4
must contains /*
in the end ($/BranchA
- not working, $/BranchA/*
- working).