git2gpt
git2gpt is a command-line utility that converts a Git repository to a text file. The output text file represents the Git repository in a structured format. Each file in the repository is represented by a section that starts with a line containing four hyphens (----), followed by a line with the file's path and name, and then the file's content. The text file ends with a line containing the symbols --END--. You can also add a .gptignore file to your repos to have git2gpt ignore certain files.
Installation
First, make sure you have the Go programming language installed on your system. You can download it from the official Go website.
To install the git2gpt utility, run the following command:
go install github.com/chand1012/git2gpt
This command will download and install the git2gpt binary to your $GOPATH/bin directory. Make sure your $GOPATH/bin is included in your $PATH to use the git2gpt command.
Usage
To use the git2gpt utility, run the following command:
git2gpt [flags] /path/to/git/repository
Ignoring Files
By default, your .git directory and your .gitignore and LICENSE files are ignored. If you want to change this behavior, you should add a .gptignore file to your repository. The .gptignore file should contain a list of files and directories to ignore, one per line. The .gptignore file should be in the same directory as your .gitignore file. Please note that this overwrites the default ignore list, so you should include the default ignore list in your .gptignore file if you want to keep it.
Flags
-p, --preamble: Path to a text file containing a preamble to include at the beginning of the output file.
-o, --output: Path to the output file. If not specified, will print to standard output.
-e, --estimate: Estimate the tokens of the output file. If not specified, does not estimate.
Contributing
Contributions are welcome! To contribute, please submit a pull request or open an issue on the GitHub repository.
License
git2gpt is licensed under the MIT License. See the LICENSE file for more information.