git-delete-merged-branches


Namegit-delete-merged-branches JSON
Version 4.0.0 PyPI version JSON
download
home_pagehttps://github.com/hartwork/git-delete-merged-branches
SummaryCommand-line tool to delete merged Git branches
upload_time2020-08-05 16:38:38
maintainer
docs_urlNone
authorSebastian Pipping
requires_python>=3.6
licenseGPLv3+
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # git-delete-merged-branches

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


# Installation

```console
pip install git-delete-merged-branches
```


# Example

```console
# 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 certain forms of de-facto merges
  (certain no-squash rebase merges as well as
  certain single or range cherry-picks,
  as recognized by `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 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 branch --delete` is used without `--force` whereever possible
- `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`).


# Support

Please report any bugs that you find.

Like this tool?  Support it with a star!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hartwork/git-delete-merged-branches",
    "name": "git-delete-merged-branches",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sebastian Pipping",
    "author_email": "sebastian@pipping.org",
    "download_url": "https://files.pythonhosted.org/packages/66/1d/26d008166e8dad9b7fec21fc0fa3a7d78b0f15993417bbefb5cf13b3143c/git-delete-merged-branches-4.0.0.tar.gz",
    "platform": "",
    "description": "# git-delete-merged-branches\n\nA convenient command-line tool helping you keep repositories clean.\n\n\n# Installation\n\n```console\npip install git-delete-merged-branches\n```\n\n\n# Example\n\n```console\n# git-delete-merged-branches\nDo you want to run \"git remote update --prune\" for 1 remote(s):\n  - origin\n\nUpdate? [y/N] y\nDo you want to run \"git pull --ff-only\" for 1 branches(s):\n  - master\n\nPull? [y/N] y\nYou are about to delete 6 local branch(es):\n  - improve-setup-py\n  - issue-12-enable-ci-for-pull-requests\n  - issue-5-fix-waste-of-one-second-per-service\n  - keep-github-actions-up-to-date\n  - refactoring-one\n  - simple-ci\n\nDelete? [y/N] y\n6 local branch(es) deleted.\nYou are about to delete 6 remote branch(es):\n  - origin/improve-setup-py\n  - origin/issue-12-enable-ci-for-pull-requests\n  - origin/issue-5-fix-waste-of-one-second-per-service\n  - origin/keep-github-actions-up-to-date\n  - origin/refactoring-one\n  - origin/simple-ci\n\nDelete? [y/N] y\nTo github.com:hartwork/wait-for-it.git\n - [deleted]         improve-setup-py\n - [deleted]         issue-12-enable-ci-for-pull-requests\n - [deleted]         issue-5-fix-waste-of-one-second-per-service\n - [deleted]         keep-github-actions-up-to-date\n - [deleted]         refactoring-one\n - [deleted]         simple-ci\n6 remote branch(es) deleted.\n```\n\n\n# Features\n\n- Supports deletion of both local and remote branches\n- Detects certain forms of de-facto merges\n  (certain no-squash rebase merges as well as\n  certain single or range cherry-picks,\n  as recognized by `git cherry`)\n- Supports workflows with multiple release branches, e.g. only delete branches that have been merged to *all* of `master`, `dev`  and `staging`\n- Quick interactive configuration\n- Provider agnostic: Works with GitHub, GitLab and any other Git hosting\n- Takes safety seriously\n\n\n# Safety\n\nDeletion is a sharp knife that requires care.\nWhile `git reflog` would have your back in most cases,\n`git-delete-merged-branches` takes safety seriously.\n\nHere's what `git-delete-merged-branches` does for your safety:\n- No branches are deleted without confirmation or passing `--yes`.\n- Confirmation defaults to \"no\"; plain `[Enter]`/`[Return]` does not delete.\n- `git branch --delete` is used without `--force` whereever possible\n- `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.\n- There is no use of `os.system` or shell code to go wrong.\n- With `--dry-run` you can get a feel for the changes that `git-delete-merged-branches` would be making to your branches.\n- Show any Git commands run using `--verbose`.\n\n\n# Best Practices\n\nWhen the repository is a fork\n(with an upstream remote and a fork remote):\n\n- Make sure that release branches are tracking the right remote,\n  e.g. `master` should probably track original upstream's `master`\n  rather than `master` of your fork.\n- Consider keeping your fork's remote `master` up to date (using `git push`).\n\n\n# Support\n\nPlease report any bugs that you find.\n\nLike this tool?  Support it with a star!\n\n\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "Command-line tool to delete merged Git branches",
    "version": "4.0.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "2324150e204865a22d9e7624e66bac47",
                "sha256": "85c702d4369b8df28d3705f685861d9f985514ee36bebf6c05d0dd858ac589c7"
            },
            "downloads": -1,
            "filename": "git_delete_merged_branches-4.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2324150e204865a22d9e7624e66bac47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14561,
            "upload_time": "2020-08-05T16:38:37",
            "upload_time_iso_8601": "2020-08-05T16:38:37.040063Z",
            "url": "https://files.pythonhosted.org/packages/43/12/02524717ab1347971f01b1f2ef751f3159627110a6443fb2d49671b036fd/git_delete_merged_branches-4.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "7da7f2ad782bd2949967aea819a449f8",
                "sha256": "51fd17ff98a13229f0cfd4741fd6bfad946cf78da0d17a55d488c35cbeecde1c"
            },
            "downloads": -1,
            "filename": "git-delete-merged-branches-4.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7da7f2ad782bd2949967aea819a449f8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 12249,
            "upload_time": "2020-08-05T16:38:38",
            "upload_time_iso_8601": "2020-08-05T16:38:38.221739Z",
            "url": "https://files.pythonhosted.org/packages/66/1d/26d008166e8dad9b7fec21fc0fa3a7d78b0f15993417bbefb5cf13b3143c/git-delete-merged-branches-4.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-08-05 16:38:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "hartwork",
    "error": "Could not fetch GitHub repository",
    "lcname": "git-delete-merged-branches"
}
        
Elapsed time: 0.17167s