Skip to content

Instantly share code, notes, and snippets.

View orvitpng's full-sized avatar

Carter Davis orvitpng

  • Austin, Texas
View GitHub Profile
import os
import subprocess
def get_git_tracked_files(directory_path):
try:
os.chdir(directory_path)
result = subprocess.run(['git', 'ls-files'], capture_output=True, text=True, check=True)
tracked_files = result.stdout.splitlines()
return tracked_files
except subprocess.CalledProcessError: