Listing names of changed files between git commits - a step-by-step guide
When working with Git, it's important to know what files have been changed between commits. This can be easily accomplished by using the "git diff" command, which shows the differences between two commits.
Step 1: Identify the commits you want to compare. You can use "git log" to view a list of all the commits in your repository.
Step 2: Use the "git diff" command to compare the two commits. For example, if you want to compare the most recent commit with the one before it, use the command "git diff HEAD~1 HEAD".
Step 3: The output will show the changes made to each file between the two commits. To only see the list of file names that have been changed, use the "--name-only" flag. The command would then be "git diff --name-only HEAD~1 HEAD".
Step 4: If you only want to see the files that have been added or deleted, you can use the "--diff-filter" flag. For example, to only see the deleted files, use the command "git diff --name-only --diff-filter=D HEAD~1 HEAD".
By following these steps, you can easily list the names of changed files between Git commits, giving you a clear understanding of the changes made to your code base.