Reputation: 8395
I have setup a process to automatically generate scripts for our database objects and place them in a folder. I manually added the folder to TFS. I would like to automatically detect changes between TFS and my folder, create a changeset based on the differences, and then checkin the changeset. The following command displays all the differences that need to be updated in TFS:
tf folderdiff . /r /i
This could also be written as the following:
tf folderdiff . /recursive /noprompt
This command correctly identifies all the files that need to be added (target), deleted (source), and updated (different). However, this is only an information output and I really don't want to have to write code to scrape it and take actions based on it. My suspicion is that there is some obvious command that I am missing that I should use to generate the correct changeset. What code will automatically detect changes and add them to a changeset?
Once I add changes to the changeset, I'll run the below code to checkin the changeset:
tf checkin /comment:"Change automatically detected." /override:"Automated commandline checkin." /noprompt
Upvotes: 2
Views: 394
Reputation: 78623
Use the Team Foundation Server Power Tools - it includes the tfpt.exe
command line tool which includes the online
command that will locate changes and pend the appropriate adds, edits or deletes. You can then check in the resultant changeset. It's as simple as:
tfpt online /adds /deletes
tf checkin
Upvotes: 3