Find who added a file to git repo

To find which user and when a file gets committed to a git repository, you can use the command

git log --diff-filter=A -- FILE_NAME_HERE

For example

boby@sok-01:~$ git log --diff-filter=A -- global_evildoer.php
commit 263f547cecba129b14faeb412b33ef43c678cced
Author: php user
Date:   Fri Nov 18 23:27:01 2022 -0800

    brunch changes
boby@sok-01:~$
Advertisement
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement