Last active
November 2, 2022 11:27
-
-
Save jlainezs/2dc22ebda3bbbc9db287e466fa2a5d47 to your computer and use it in GitHub Desktop.
Steps to create a zip file with the changed files of a branch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Zip changed files on a branch checked out from an initial branch. | |
# Open a terminal on the repository root. | |
# Tested with Git Bash. Requires 7z installed | |
# get the last commit on the updated branch | |
git merge-base initial_branch_name updated_branch_name | |
# get the changed files name (with full path) | |
git diff --name-only COMMIT_ID > diff-filelist.txt | |
# Create the zip package out of the repository | |
7z -tzip a ../archive_name.zip @diff-filelist.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment