Skip to content

How to list all files been tracked by git? #1277

Answered by Byron
shlomiLan asked this question in Q&A
Discussion options

You must be logged in to vote

You are probably looking for this:

for entry in repo.commit().tree.traverse():
    print(entry)

There are fields or methods on the returned entries to obtain their name or path relative to the root tree.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Comment options

You must be logged in to vote
1 reply
@Byron
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1273 on June 23, 2021 11:43.