I am trying to checkout the modified files of a given commit. Or, checkout the modified files between two given commits (or two given branches) in to another branch.
Here is what I have done so far:
- Prepare a branch with the last last deployment "Depl_A"
- Switch to next deployment branch "Depl_B"
- Copy the modified files to branch "Depl_B"
- Created a blank branch using:
git clone --no-checkout <url>
git reset
git switch Depl_B_files
git add .
git commit -m "Prepare the branch with the modified files only for Deployment B" --allow-empty
git push origin --set-upstream Depl_B_files
- Following the instruction here, I am trying to bring (into Depl_B_files) the changed files only between Depl_A and Depl_B using a quick way, but could not apply that in my case since I am on Windows and using PowerShell.
My intention is to prepare a branch that has only the modified files so that I can use it as the source to deploy such files into the target platform. The files should be checked out from the deployment branch Depl_B_files
and copied to the target folder on the machine using Jenkins and PowerShell.
Is there a better way? Can you help me achieve by objective?