
Prepare Git-Tracked Code for LLMs
When working with large language models (LLMs), it’s often useful to feed them the source code of a project for analysis, refactoring, or documentation assistance. However, simply copying folders is messy — you usually only want the text files that are tracked by Git, displayed cleanly, without non-text files or noise. To streamline this, I wrote a Bash script that: Ensures you are inside a Git repository. Lists all Git-tracked files. Filters out non-text files. Skips empty or unreadable files. Prints the content of each file, with a clean header showing the relative path. Perfect for quickly preparing a project snapshot to paste into an LLM. ...