Re: Find commit that referenced a blob first
- From
Stefan Beller <sbeller@google.com>
- Date
- Jul 19, 2018, 21:19 UTC
- Message-ID
- <CAGZ79kbJnyRbeH8yMa=QaqNofA_Ek_SwmH5qRaCaq4cyQ26Kqg@mail.gmail.com>
- In-Reply-To
- <C00CED1F-D685-40E5-A5CC-4040BFD82886@gmail.com>
On Thu, Jul 19, 2018 at 2:02 PM Lars Schneider <larsxschneider@gmail.com> wrote:
Show 5 quoted lines
> > Hi, > > I have a blob hash and I would like to know what commit referenced > this blob first in a given Git repo.
git describe <blob>
If the given object refers to a blob, it will be described as <commit-ish>:<path>, such that the blob can be found at <path> in the <commit-ish>, which itself describes the first commit in which this blob occurs in a reverse revision walk from HEAD.
Since 644eb60bd01 (builtin/describe.c: describe a blob, 2017-11-15) (included first in 2.16.0
You're welcome, Stefan