I have a project which sources are controlled with help of git.
Right now I want to find out when my teammate made last edits in a specific file. I want to find out SHA1 of commit or to see his edits as diff.
I guess I can use git log --stat <path/to/file>
and review list of all commits where my file was changed.
Are there any quick ways to do it?
you can use git log with a pathspec and --author
option:
git log --author=your_teammate -- path/to/file
Yes! you can use git blame
git blame <file>
every line of that file will be shown who is the one edited the last.
I would use this linegit log --format="%H--%ad-%an" fileName
If you only want the last change, use thisgit log --format="%H--%ad-%an" -n 1 fileName
If you are looking for a single specific author, pipe it through grepgit log --format="%H--%ad-%an" fileName | grep "Author Name"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With