to just get a list of the files that changed in the last commit, you can use
git log -1 --name-only --pretty=''
which will give you a list of just the file names.
If you want to have said list in a bash variable, you can simply do this:
CHANGED=$(git log -1 --name-only --pretty='')
If you didn't know, the $()
escapes whatever command is inside the parentheses (bash only, I think).
If you want to run the same command in Windows CMD, you need double quotes (--pretty=""
)
you can then pass those file names to whatever scripts you want to run. One issue is that the list is space-separated, so if the file names have spaces, it could be impossible to know which paths are real files or not. I have not found a way to change the separator.