Git - last commit until some date across branches

76 views Asked by At

I am a teacher and I need to work with the commit sent as last until the deadline.

I would know what to do if the student teams maintained master.

for i in `ls -1` ; do cd $i; git log -1 --until='2016-12-16'; cd - > /dev/null; done

This searches the history of the current branch. But their branches is wildly structured, they don't even merge each other's branches. So I am probably taking the latest commit from any branch.

How can I get the latest commit until some date from the whole repository?

1

There are 1 answers

1
jthill On

The date stamps are completely under committer control -- since the committer in 99+% of cases has complete control over the system clock, git trying to "secure" it would be a laughable waste.

That said,

git log --all --date-order -1 --before="midnight 01 Jan 2017"