# 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:
```bash
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:
```bash
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](https://stackoverflow.com/a/26000395/10386667).
## 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](/LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/developer0hye/commitcleaner",
"name": "commitcleaner",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "git commit clean",
"author": "Yonghye Kwon",
"author_email": "developer.0hye@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ce/54/7ea34d4d76ee4f503d9e252ff9eee84d311de37390fab53890816fe722c8/commitcleaner-0.6.0.tar.gz",
"platform": null,
"description": "# CommitCleaner\r\n\r\nCommitCleaner 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.\r\n\r\n## Features\r\n\r\n- Removes Git commit history\r\n- Retains the current state of the code\r\n- Creates a new initial commit\r\n\r\n## Installation\r\n\r\nCommitCleaner is written in Python and can be easily installed via pip:\r\n\r\n```bash\r\npip install commitcleaner\r\n```\r\n\r\n## Usage\r\nOnce installed, you can execute the `commitcleaner` command in your command line within the directory of your Git repository to reset its commit history:\r\n\r\n```bash\r\ncd {your project}\r\ncommitcleaner\r\n```\r\n\r\nThis command performs the following actions:\r\n\r\n1. Creates an orphan branch named `latest_branch`.\r\n2. Adds all files to the staging area.\r\n3. Creates a new commit with the message \"Initial commit\".\r\n4. Deletes the existing `main` branch.\r\n5. Renames the current branch to `main`.\r\n6. Force pushes the changes to the remote repository.\r\n\r\n## Caution\r\n- It is advisable to backup important data before using this tool, as the process of removing commit history is irreversible.\r\n- Force pushing (`git push -f`) to a remote repository can cause synchronization issues with other collaborators. Discuss with your team before using.\r\n\r\n## Acknowledgments\r\nThis 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](https://stackoverflow.com/a/26000395/10386667).\r\n\r\n## Credits\r\nThis 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.\r\n\r\n## Contributing\r\nIf 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!\r\n\r\n## License\r\nThis project is distributed under the [MIT License](/LICENSE).\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A tool to clean Git commit history.",
"version": "0.6.0",
"project_urls": {
"Homepage": "https://github.com/developer0hye/commitcleaner"
},
"split_keywords": [
"git",
"commit",
"clean"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5fd339660e843b844164ce8f3fb84e2021abd5b85631f449cfa1fb983df7f5c3",
"md5": "e38bdd5845e5da409d08dbec0eb9e8ff",
"sha256": "66848055aeb3c38a39ed0d4515346519199d02aecb80452a2078112c3443d067"
},
"downloads": -1,
"filename": "commitcleaner-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e38bdd5845e5da409d08dbec0eb9e8ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4063,
"upload_time": "2024-01-30T14:59:10",
"upload_time_iso_8601": "2024-01-30T14:59:10.377061Z",
"url": "https://files.pythonhosted.org/packages/5f/d3/39660e843b844164ce8f3fb84e2021abd5b85631f449cfa1fb983df7f5c3/commitcleaner-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ce547ea34d4d76ee4f503d9e252ff9eee84d311de37390fab53890816fe722c8",
"md5": "7c99131f52276eb03f6b0db5a682f095",
"sha256": "0bb68e77d8805f7739aa3f21e3e8b93de14c053fedad0b08d615444c32f3f979"
},
"downloads": -1,
"filename": "commitcleaner-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "7c99131f52276eb03f6b0db5a682f095",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3464,
"upload_time": "2024-01-30T14:59:12",
"upload_time_iso_8601": "2024-01-30T14:59:12.063954Z",
"url": "https://files.pythonhosted.org/packages/ce/54/7ea34d4d76ee4f503d9e252ff9eee84d311de37390fab53890816fe722c8/commitcleaner-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-30 14:59:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "developer0hye",
"github_project": "commitcleaner",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "commitcleaner"
}