I have a program which create a new branch when I give it the required arguments.
After creating the new branch, I would like to check-out a project file, add some post-build events, and then check it in again.
How can I do that?
You need to use the workspace method, PendEdit(string Path) http://msdn.microsoft.com/en-us/library/bb139369.aspx
So you could do this,
GetStatus status = workspace.Get(new GetRequest("FilePath", RecursionType.None, VersionSpec.Latest),GetOptions.Overwrite);
workspace.PendEdit("FilePath");
HTH Cheers, Tarun
来源:https://stackoverflow.com/questions/6764883/programatically-checkout-a-file-in-tfs-2010