Add plugin and alias to delete the stale branch on local
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):
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.txtand formatted it usinglint_clean_files.sh. - [ ] I have added tests to cover my changes, and all the new and existing tests pass.