bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

Add plugin and alias to delete the stale branch on local

Open tbhaxor opened this issue 3 years ago • 0 comments

Description

This pull request allows the developers to delete the stale branches from the repository without affecting the default base branch (main / master) and currently checked out branch.

Please note it will not affect your origin refs. Only the local branches will be deleted. For the safe-side, the command will perform git branch -d operation. However you can run this command aggressively by providing --force or -f option.

Motivation and Context

Most of the time I have faced problems while managing the local repository getting confused between branches and so found this technique to have a clean local repository by deleted the merged or stale branches.

How Has This Been Tested?

This is currently tested on macOS in current bashit local setup. Check the screenshot attached.

Screenshots (if appropriate):

Screenshot 2022-03-07 at 11 32 03 AM

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] If my change requires a change to the documentation, I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • [ ] I have added tests to cover my changes, and all the new and existing tests pass.

tbhaxor avatar Mar 07 '22 06:03 tbhaxor