All Projects → hartwork → Git Delete Merged Branches

hartwork / Git Delete Merged Branches

Licence: gpl-3.0
Command-line tool to delete merged Git branches

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Git Delete Merged Branches

Pipedream
Connect APIs, remarkably fast. Free for developers.
Stars: ✭ 2,068 (+605.8%)
Mutual labels:  automation, cli
Backport
A simple CLI tool that automates the process of backporting commits on a GitHub repo
Stars: ✭ 154 (-47.44%)
Mutual labels:  automation, cli
Fjpublish
A simple CLI for publish your projects.
Stars: ✭ 126 (-57%)
Mutual labels:  automation, cli
Appicon
AppIcon generates *.appiconset contains each resolution image for iOS
Stars: ✭ 1,454 (+396.25%)
Mutual labels:  automation, cli
Mbt
The most flexible build tool for monorepo
Stars: ✭ 184 (-37.2%)
Mutual labels:  automation, cli
Cli
Get a programmable email address. Automate what happens when you receive emails. It's like Zapier for devs who hate emails.
Stars: ✭ 105 (-64.16%)
Mutual labels:  automation, cli
Brotab
Control your browser's tabs from the command line
Stars: ✭ 137 (-53.24%)
Mutual labels:  automation, cli
Dog
Dog wants to be a very good task runner
Stars: ✭ 84 (-71.33%)
Mutual labels:  automation, cli
Tox
Command line driven CI frontend and development task automation tool.
Stars: ✭ 2,523 (+761.09%)
Mutual labels:  automation, cli
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (-38.23%)
Mutual labels:  automation, cli
Awesome React Generator
No more clicking around to create files in your react project! Awesome React Generator is Command Line Tool that let's you scaffold your components without leaving your terminal.
Stars: ✭ 98 (-66.55%)
Mutual labels:  automation, cli
Go Expect
an expect-like golang library to automate control of terminal or console based programs.
Stars: ✭ 236 (-19.45%)
Mutual labels:  automation, cli
Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+338.57%)
Mutual labels:  automation, cli
Autobahn
CLI tool written in Swift heavily inspired by https://github.com/fastlane/fastlane
Stars: ✭ 116 (-60.41%)
Mutual labels:  automation, cli
Nzb Subliminal
Fetches subtitles for the videos it's provided. It can be easily integrated into NZBGet and SABnzbd too.
Stars: ✭ 85 (-70.99%)
Mutual labels:  automation, cli
Arkade
Open Source Kubernetes Marketplace
Stars: ✭ 2,343 (+699.66%)
Mutual labels:  automation, cli
Spam Bot 3000
Social media research and promotion, semi-autonomous CLI bot
Stars: ✭ 79 (-73.04%)
Mutual labels:  automation, cli
Ritchie Formulas
This repository contains the community formulas that can be executed through Ritchie CLI once imported. This tool is an open source product that allows you to create, store and share any kind of automations, executing them through command lines, to run operations or start workflows ⚙️ 🖥 💡
Stars: ✭ 84 (-71.33%)
Mutual labels:  automation, cli
Licenseplist
A license list generator of all your dependencies for iOS applications
Stars: ✭ 1,996 (+581.23%)
Mutual labels:  automation, cli
N8n
Free and open fair-code licensed node based Workflow Automation Tool. Easily automate tasks across different services.
Stars: ✭ 19,252 (+6470.65%)
Mutual labels:  automation, cli

git-delete-merged-branches

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

Installation

# pip install git-delete-merged-branches

Example

# git-delete-merged-branches
Do you want to run "git remote update --prune" for 1 remote(s):
  - origin

Update? [y/N] y

Do you want to run "git pull --ff-only" for 1 branches(s):
  - master

Pull? [y/N] y

You are about to delete 6 local branch(es):
  - improve-setup-py
  - issue-12-enable-ci-for-pull-requests
  - issue-5-fix-waste-of-one-second-per-service
  - keep-github-actions-up-to-date
  - refactoring-one
  - simple-ci

Delete? [y/N] y

6 local branch(es) deleted.
You are about to delete 6 remote branch(es):
  - origin/improve-setup-py
  - origin/issue-12-enable-ci-for-pull-requests
  - origin/issue-5-fix-waste-of-one-second-per-service
  - origin/keep-github-actions-up-to-date
  - origin/refactoring-one
  - origin/simple-ci

Delete? [y/N] y
To github.com:hartwork/wait-for-it.git
 - [deleted]         improve-setup-py
 - [deleted]         issue-12-enable-ci-for-pull-requests
 - [deleted]         issue-5-fix-waste-of-one-second-per-service
 - [deleted]         keep-github-actions-up-to-date
 - [deleted]         refactoring-one
 - [deleted]         simple-ci

6 remote branch(es) deleted.

Features

  • Supports deletion of both local and remote branches
  • Detects multiple forms of de-facto merges (rebase merges, squash merges (needs --effort=3), single or range cherry-picks… leveraging git cherry)
  • 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, Gitea 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

When the repository is a fork (with an upstream remote and a fork remote):

  • Make sure that release branches are tracking the right remote, e.g. master should probably track original upstream's master rather than master of your fork.
  • Consider keeping your fork's remote master up to date (using git push).

When using GitHub:

Name clash on "git-delete-merged-branches" with git-extras

Utility collection git-extras provides a simple shell script named git-delete-merged-branches that competes for command git-delete-merged-branches when both software packages are installed.

To address this conflict you can:

  • a) Invoke python3 -m git_delete_merged_branches instead of git-delete-merged-branches
  • b) Invoke command git-dmb instead of git-delete-merged-branches
  • c) Control path resolution order through environment variable $PATH
  • d) Invoke git-delete-merged-branches with its absolute path. You can run which -a git-delete-merged-branches to see where it's located.

Support

Please report any bugs that you find.

Like this tool? Support it with a star!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].