Is there a way in git to find the first (second, third) git commit that's not my own commit going back in time?
The following commands may prove useful:
git shortlog
git log --committer '^(?!YOURAUTHORNAME).*$' --perl-regexp
or similarly,
git log --author '^(?!YOURAUTHORNAME).*$' --perl-regexp
These two variations of log use a regular expression to say "not my user."
You can find info on these commands here. Obviously replace YOURAUTHORNAME with enough characters of your own username to make it unique. If you absolutely only want the single most recent commit, include the --max-count=1 argument to the log command.
As demonstrated with other answers, there are many ways to produce this, including using other linux tools like grep or sed.
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