0

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?

Harshdeep Singh
  • 327
  • 1
  • 5
  • 18

1 Answers1

1

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

another aproach

if you want just to check the date of an specific commit use this command

git show -s --format=%ci <commit>

Pythonic way

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