letimome
letimome

Reputation: 936

View commits for a given directory at a particular date in Github

I want to view all the commits for a given "directory" and after a given date, in Github. I have read Github API documentation and "path" and "since" parameters do the job. https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository

However, I am not able to view them on Github. "Since" parameter seems not to work on Github. Example: https://github.com/torvalds/linux/commits?path=Documentation&since=2016-04-04T16:00:49Z

Any idea how can I achieve this?

Thanks, Leticia

Upvotes: 6

Views: 4042

Answers (2)

raven
raven

Reputation: 2431

You could use either this:

git log -- path/ --since="date"

Or this to check a file history

 git log -- path/myfile.txt --since="date"

In github you would have to do this:

https://github.com/torvalds/linux/commits/master@{date}/Documentation

for your particular example:

https://github.com/torvalds/linux/commits/master@{2016-04-04T16:00:49Z}/Documentation

Upvotes: 3

MSameer
MSameer

Reputation: 443

  • Command line:

    Use git log --since option.

    git log --since="2015-12-01"

    This will tell all commits/actions since December 01 2015. Checkout link Git commit history

EDIT:

  • Git hub:

    As per my research, there is no trivial solution to view github commits "after" a particular day. You can however use compare option to compare repo/branches between two time periods, this will give you a view of commits "after" particular day.

    E.g: The following compares branches between two time periods, thereby listing all commits between this period.

    https://github.com/torvalds/linux/compare/master@{2016-04-14}...master@{2016-04-25}

    Hope, this helps!

    Note: I would recommend command line when possible as it definitely gives you more flexibility.

Upvotes: 7

Related Questions