Skip to main content

git2prompt

git2prompt is a command-line utility that converts a local Git repository into a formatted text representation. This can be useful for sharing code snippets, project structures, or entire repositories in a plain text format, without needing to archive or transmit the actual files.

Installation

pip install git2prompt --user

Usage

To use git2prompt, simply run the git2prompt script and provide the path to the Git repository you want to convert:

git2prompt /path/to/your/repo

This will output the formatted text representation of the repository to the console.

Output Format

The output follows this structure: The text represents a Git repository with the following format:

filename: The name of the file, within a repository format: The format of the file contents The repository ends with --END--

Any text after --END-- are instructions related to the repository.

Copy code

Each file in the repository is represented as a block, with the filename, file format, and contents included. The supported file formats are:

  • Text files (.txt)
  • Markdown files (.md)
  • HTML files (.html)
  • Python scripts (.py)

After all file blocks, the output ends with --END--. Any text after this line is considered instructions related to the repository.

Ignored Files

git2prompt respects .gitignore files in the repository. Any files or directories listed in these ignore files will be excluded from the output.

Example

Running python -m git2prompt /path/to/your/repo with the provided example repository will output: ```

License

This project is licensed under the MIT License.

Metadata

Release files for git2prompt 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git2prompt 0.1.0
File Size Uploaded Provenance Actions
git2prompt-0.1.0.tar.gz 3.1 kB Without provenance Details for git2prompt-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git2prompt 0.1.0
File Interpreter ABI Platform Actions
git2prompt-0.1.0-py3-none-any.whl Python 3 none any Details for git2prompt-0.1.0-py3-none-any.whl

Total release size: 7.3 kB

Release files / git2prompt-0.1.0.tar.gz

Download URL git2prompt-0.1.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
61c1898870284e9e632b20c33429b094ff9ba9db02826059d4f89d1352d30438
BLAKE2b-256 checksum
How to use checksums
1c11096083c6896e28def50ab3e9a7b8d2b5e01a3c69b8164f37603cf38ef2fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / git2prompt-0.1.0-py3-none-any.whl

Download URL git2prompt-0.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28d6058997a9657adc5e297238c01d5a2d02c1788be08d58e5ce20634ad26cd4
BLAKE2b-256 checksum
How to use checksums
eb937ded1d0d4a30f682309ae008c2113d47c3fdeeb565d4bc6fc1fdc4aab0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Security for git2prompt 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page