Reputation: 2007
Is there a simple way to find out when (in which commit or merge) a file was added to a branch? Specially, from an experimental feature branch to master.
Upvotes: 0
Views: 207
Reputation: 19475
You can use
git log --first-parent -- <file>
to list the commits along the main branch which have modified that file. The last one listed would be the commit where the file was introduced to the main branch.
This does depend on merges being done while on the main (e.g. master
) branch to pull in change from the other branches, and not the other way around.
Upvotes: 0