Created
November 21, 2023 01:39
-
-
Save grantjenks/62d45d1f279effe85c52cd7a6c57d113 to your computer and use it in GitHub Desktop.
Print all the files tracked by Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
from pathlib import Path | |
output = subprocess.run(['git', 'ls-files'], stdout=subprocess.PIPE, text=True, check=True) | |
paths = [Path(path) for path in output.stdout.strip().split('\n')] | |
for path in paths: | |
print(path) | |
print('----') | |
print(path.read_text()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment