Reputation: 337
I want to somehow want to see if there is a way to get the time for when a file was committed
on Github. I have tried using PyGithub
and GitPython
, but they don't have any options as such. Does anyone know a way around this?
Upvotes: 0
Views: 300
Reputation: 900
you can check the hour in the log
so do git log
to check all commits hours.
but if you want an specific file, you should use the flag --follow
so try this:
git log --follow filename
if you want just to check the date of an specific commit use this command
git show -s --format=%ci <commit>
import git
g = git.Git("/path/to/your/repo")
loginfo = g.log()
print loginfo
or
import git
g = git.Git("/path/to/your/repo")
loginfo = g.log('--format=%ci <commit>')
print loginfo
Upvotes: 1