Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Get commit time of each File in tree #1369

Unanswered
dsharma522 asked this question in Q&A
Discussion options

There is no way to get the commit time of a FILE in the tree , as something we can get via command

git log -1 --pretty="format:%cI" <file_path>

repo = git.Repo('some_repo')
tree = repo.tree().traverse()
for blob in tree:
 print(blob.path)
 if os.path.isfile(blob.abspath):
 # get commit_time of blob something like 'git log -1 --pretty="format:%cI" blob.path'
 pass
You must be logged in to vote

Replies: 1 comment

Comment options

See answer in #1367 .

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1368 on October 24, 2021 13:13.

AltStyle によって変換されたページ (->オリジナル) /