Skip to main content

Command-line tool to delete merged Git branches

Project description

git-delete-merged-branches

A convenient command-line tool helping you keep repositories clean.

Installation

pip install git-delete-merged-branches

Features

  • Supports deletion of both local and remote branches
  • Supports workflows with multiple release branches, e.g. only delete branches that have been merged to all of master, dev and staging
  • Quick interactive configuration
  • Provider agnostic: Works with GitHub, GitLab and any other Git hosting
  • Takes safety seriously

Safety

Deletion is a sharp knife that requires care. While git reflog would have your back in most cases, git-delete-merged-branches takes safety seriously.

Here's what git-delete-merged-branches does for your safety:

  • No branches are deleted without confirmation or passing --yes.
  • Confirmation defaults to "no"; plain [Enter]/[Return] does not delete.
  • git push is used with --force-with-lease so if the server and you have a different understanding of that branch, it is not deleted.
  • There is no use of os.system or shell code to go wrong.
  • With --dry-run you can get a feel for the changes that git-delete-merged-branches would be making to your branches.
  • Show any Git commands run using --verbose.

Best Practices

  • Consider running git remote update --prune before using git-delete-merged-branches for best results.
  • Consider using ssh-agent if you don't want to enter your SSH key password for each git push when working with multiple remotes.

Support

Please report any bugs that you find.

Like this tool? Support it with a star!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-delete-merged-branches-1.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

git_delete_merged_branches-1.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file git-delete-merged-branches-1.1.0.tar.gz.

File metadata

  • Download URL: git-delete-merged-branches-1.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for git-delete-merged-branches-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b45cbab841b2ccdb67d62aad5dc4ee47f7782c54ef59a13f06947f0e9ae3b79e
MD5 21ae22e7bbd374d32d63e464eb18f3c7
BLAKE2b-256 28dcc951200af95624b6cfb761025f08bff49f180920ca0b6e11153eb55bb5de

See more details on using hashes here.

File details

Details for the file git_delete_merged_branches-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: git_delete_merged_branches-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for git_delete_merged_branches-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da481fee37d25903cddd24b3e40a68e09915c133720262655d0a55c2a6d5ff2a
MD5 4ee5ab16cc006067996698a8e7334a8d
BLAKE2b-256 2de11f2ba6953a023fffecf50a4c8ba5fc79b1b95506355baf88f2f05c814db3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page