0

I've been working on a project from a few months now and I'm moving to a new version and I need to check if the changes have been done by someone else or find what is different. Is there a way to look back at my branch and only see the files that have changed in a certain folder over a number of commits?

Thanks

Kieran

  • Does this answer your question? [How do I find the most recent git commit that modified a file?](https://stackoverflow.com/questions/4784575/how-do-i-find-the-most-recent-git-commit-that-modified-a-file) – LeGEC Aug 20 '20 at 14:33

1 Answers1

0

You can run git log on your local clone of the repo :

# this will list the commits that touched target files or directories :
git log --graph -- path/to/file1 path/to/file2
git log --graph -- path/to/directory

# add the -p option if you want to view the diff for each commit at the same time :
git log --graph -p -- path/to/file1 path/to/file2
LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • Thanks. So it shows me the logs, is there a way for it to show me the individual files that have been changed, not the diff? – Kieran Briggs Aug 21 '20 at 08:28
  • 1
    `--name-only` or `--name-status` instead of `-p`. These options works with all commands that show the content of a commit : `git log`, `git show`, `git diff` ... – LeGEC Aug 21 '20 at 08:54