How it works...

In step 1, we called SolutionPackager with the /action:Extract and /folder:.TempSolution parameters to explode the solution to the TempSolution folder.

If we didn't use a staging folder, SolutionPackager would have deleted all the files in the destination folder that are missing from the extracted solution, including the .git folder.

The robocopy command in step 2 moved all the files from the TempSolution folder to the Git repository directory Solution. The /purge option ensured all files missing from the source were deleted in the destination, while /xd ensured the .git folder was ignored (in order to avoid deleting your git repository details). The /e option ensured all files were moved recursively, including folders and subfolders.

In step 3, we staged all the changes to be committed. The status from step 4 should look like what is shown in the following figure if this is the first time the files are being committed:

In step 5, we committed the changes locally.

In step 6, we repeated the same process with the updated solution that has fewer elements. The status in step 7 will highlight the fragment changes and the deleted items, as the following screenshot shows:

Finally, in step 8, we commited the latest changes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset