Skip to main content

CommitCleaner

CommitCleaner is a tool designed to neatly reset the commit history of your Git repository while keeping the current state of the code intact. This utility allows you to maintain a clean repository, starting afresh without the clutter of unnecessary history.

Features

  • Removes Git commit history
  • Retains the current state of the code
  • Creates a new initial commit

Installation

CommitCleaner is written in Python and can be easily installed via pip:

pip install commitcleaner

Usage

Once installed, you can execute the commitcleaner command in your command line within the directory of your Git repository to reset its commit history:

cd {your project}
commitcleaner

This command performs the following actions:

  1. Creates an orphan branch named latest_branch.
  2. Adds all files to the staging area.
  3. Creates a new commit with the message "Initial commit".
  4. Deletes the existing main branch.
  5. Renames the current branch to main.
  6. Force pushes the changes to the remote repository.

Caution

  • It is advisable to backup important data before using this tool, as the process of removing commit history is irreversible.
  • Force pushing (git push -f) to a remote repository can cause synchronization issues with other collaborators. Discuss with your team before using.

Acknowledgments

This tool was inspired by a Stack Overflow answer, which provides a method for removing Git commit history while keeping the code in its current state. You can find the original solution here.

Credits

This project was generated with the assistance of ChatGPT-4, an advanced language model developed by OpenAI. The tool's concept, code snippets, and documentation were crafted through interactive sessions with the AI, showcasing the potential of AI-assisted software development.

Contributing

If you would like to contribute to the commitcleaner project, please feel free to submit an issue or a pull request on GitHub. All contributions are welcome!

License

This project is distributed under the MIT License.

Metadata

Release files for commitcleaner 0.6.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 commitcleaner 0.6.0
File Size Uploaded Provenance
commitcleaner-0.6.0.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 7.5 kB

Release files / commitcleaner-0.6.0.tar.gz

Download URL commitcleaner-0.6.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0bb68e77d8805f7739aa3f21e3e8b93de14c053fedad0b08d615444c32f3f979
BLAKE2b-256 checksum
How to use checksums
ce547ea34d4d76ee4f503d9e252ff9eee84d311de37390fab53890816fe722c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / commitcleaner-0.6.0-py3-none-any.whl

Download URL commitcleaner-0.6.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66848055aeb3c38a39ed0d4515346519199d02aecb80452a2078112c3443d067
BLAKE2b-256 checksum
How to use checksums
5fd339660e843b844164ce8f3fb84e2021abd5b85631f449cfa1fb983df7f5c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for commitcleaner 0.6.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.

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