问题
Is it possible to just say to TFS that I have a file (call it Version.txt) and I want it to be checked in at a location (say $/MyProject/MyVersionLocation) and not have any workspace setup for that location?
Something like (pretend Syntax):
tf.exe c:\Version.txt CheckIn $/MyProject/MyVersionLocation /WorkSpaceOverride
If so, how do you do it?
回答1:
It is not possible to checkin a file without a workspace mapping for that path.
One option would be to use a combination of "tf workspace" and "tf workfold" to dynamically create a workspace before checking in.
For example:
tf workspace /collection:http://server:8080/tfs/Collection /new TempWorkspace /noprompt
tf workfold /collection:<server> /workspace:TempWorkspace /map $/MyProject/MyVersionLocation/Version.txt C:\Version.txt
来源:https://stackoverflow.com/questions/4168931/check-in-a-file-to-tfs-command-line-withouth-a-work-space