Skip to main content

clean-git-branches

clean-git-branches is a command line utility for cleaning stale branches from your local git repository. The program will check for branches that have been deleted on the remote and prompt the user to confirm before deleting them locally.

Installation

To install clean, simply run the following command:

pip3 install clean-git-branches

Usage

To use clean-git-branches, navigate to the root of your local git repository in the command line and run the following command:

clean_git_branches

It is also possible pass the path as the first argument: clean_git_branches "/Users/butler/my_repo/"

The cleaner is set the be cautious by default, asking the user to verify deleting the local branches. In order to bypass this, pass False as the second argument. Examples: clean_git_branches "/Users/butler/my_repo/" False clean_git_branches "" False - will default the path to the current working directory

The program will then check for stale branches and prompt the user to confirm before deleting them (unless bypassed).

By default, the program will also protect certain branches from being deleted (master, main, dev) in case they exist on the remote repository. To change the list of protected branches, you can modify the "protected_branches" variable in the clean-git-branches.py file.

Please note that this program is only compatible with Git.

Contributing

If you would like to contribute to the development of clean-git-branches, please feel free to fork the repository and submit pull requests with your changes.

License

clean-git-branches is released under the MIT License.

Release files for clean-git-branches 1.0.3.2

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

Source distribution (sdist)

Source distribution for clean-git-branches 1.0.3.2
File Size Uploaded
clean_git_branches-1.0.3.2.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clean-git-branches 1.0.3.2
File Interpreter ABI Platform
clean_git_branches-1.0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / clean_git_branches-1.0.3.2.tar.gz

Download URL clean_git_branches-1.0.3.2.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f88969c07eef2a2adb2a6801d231ca4e199ac5ff42ed5059fffbd23e4bef2020
BLAKE2b-256 checksum
How to use checksums
61f5e020579f4fbff6df1806cbc8236bd7e3d56425c842c32739638aa99ef1b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Darwin/22.2.0

Release files / clean_git_branches-1.0.3.2-py3-none-any.whl

Download URL clean_git_branches-1.0.3.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82d0686e2a8577a0fe91b850c69e12f2332504bcbbefa772f4d6d3fe27f3e7a4
BLAKE2b-256 checksum
How to use checksums
8820b342a0455a4134223e247d99be5ad9a67e22fbca60973bc361dc8d258361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Darwin/22.2.0

Release history Release notifications | RSS feed

This release

1.0.3.2 This release

2 release files

1.0.3

2 release files

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