Created
November 22, 2021 09:43
-
-
Save yamatt/a9de791a6ff0e8ea4c4f41e51e4295c7 to your computer and use it in GitHub Desktop.
Run command against changed files in branch
This file contains hidden or 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
# When using a feature branching model against the main branch this will allow you to iterate over | |
# all the files that have changed compared to branch and run a command against each of them. | |
for file_path in $(git diff --name-only origin/main | grep '^content/'); do | |
echo "$file_path" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment