I've a repo which contains 2 directories
/repo/folder_1 /repo/folder_2
What is the command
- to get the last commit id for the folder_2 changes
- also the modified files in the last commit ?
I've a repo which contains 2 directories
/repo/folder_1 /repo/folder_2
What is the command
You can use two commands for this. First, show the commits on that folder, then show changes according to any commit shown by the first command.
git log --follow $YOUR_FOLDER
git show -p $COMMIT_ID
If you really want it in a one liner you can do this:
# Find the commit of the folder you are interested in
git log -n1 --pretty=format:"%h" --follow $YOUR_FOLDER
# Find all the files that have changed
git show --pretty=" --name-only $COMMIT_ID
# And make it a one liner
git show --pretty="" --name-only `git log -n1 --pretty=format:"%h" --follow $YOUR_FOLDER`