Hi, I have a really simple question: how do I find a last commit for the given directory inside the repository? I want to avoid rebuilding the specific part of the project if there were no changes in it since the last build, so I need to find the sha of the last time the directory was changed. Thanks, L.
Re: last commit in a directory
Am 1/25/2011 9:29, schrieb Leonid Podolny:
> I have a really simple question: how do I find a last commit for the given > directory inside the repository?
git log -1 that/directory
But if you need it in a script, this is preferable:
lastsha1=$(git rev-list -1 HEAD -- "$directory")
-- Hannes
Re: last commit in a directory
On 01/25/2011 10:47 AM, Johannes Sixt wrote:
Show 10 quoted lines
> Am 1/25/2011 9:29, schrieb Leonid Podolny: >> I have a really simple question: how do I find a last commit for the given >> directory inside the repository? > > git log -1 that/directory > > But if you need it in a script, this is preferable: > > lastsha1=$(git rev-list -1 HEAD -- "$directory") >
Thanks!