Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pswai/git-sweep
Clean up remote branches for git repo
https://github.com/pswai/git-sweep
git git-sweep maintenance
Last synced: 3 months ago
JSON representation
Clean up remote branches for git repo
- Host: GitHub
- URL: https://github.com/pswai/git-sweep
- Owner: pswai
- License: mit
- Created: 2016-03-26T13:04:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T02:20:35.000Z (almost 6 years ago)
- Last Synced: 2024-07-19T15:11:56.380Z (4 months ago)
- Topics: git, git-sweep, maintenance
- Language: JavaScript
- Size: 69.3 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## git-sweep [![npm version](https://badge.fury.io/js/git-sweep.svg)](https://badge.fury.io/js/git-sweep)
> Git utility to clean up remote branches
### Install
```
npm install -g git-sweep
```### Options
#### path
Type: `String`
Path to target git repository.
#### remote
Type: `String`
Default: `origin`
Target remote to clean up.
#### ignore
Type: `String`
Default: `origin/master`
Branches to be ignored. Must be specified in `/` format. Use comma to delimit multiple branches.
This option will be merged with the configuration in [`.gitsweepignore`](#config-file).#### preview
Type: `Boolean`
Default: `false`
Run `git-sweep` without actually deleting any branch. Useful for verifying the list of branches that will be deleted.
#### age
Type: `String`
Default: `1m`
Minimum age for a branch to be considered for deletion. Format `1y2m3d` means "older than 1 year 2 months and 3 days".
#### password
Type: `Boolean`
### Example Usage
#### Delete remote branches that are older than 1 month except `origin/master`
```
git-sweep /path/to/repo
```#### Delete older than 1 year, 2 month and 3 days
```
git-sweep /path/to/repo --age 1y2m3d
```#### Delete except `origin/master` and `origin/dev`
```
git-sweep /path/to/repo --ignore origin/master,origin/dev
```#### Delete from another remote
```
git-sweep /path/to/repo --remote fork
```#### Dry run
```
git-sweep /path/to/repo --preview
```### Config file
A `.gitsweepignore` can be added to configure the `ignore` option.
When used together with `--ignore`, their entries will be merged.### Authentication
`git-sweep` currently supports `ssh-agent` only.
### Roadmap
- Authentication methods
- [x] username/password
- HTTPS
- github 2FA
- Manual ssh key files
- Filters
- Merged branch
- Cutoff date (similar to age)
- [x] CLI help### License
[MIT](LICENSE)
### Changelog
#### v0.4.0
- Upgrade NodeGit to v0.24.0
#### v0.3.0
- Upgrade NodeGit to v0.16.0
#### v0.2.0
- Fix EOL issue in OS X
- Changed `path` to be mandatory#### v0.1.3
- Fix missing auth callbacks when actual push
#### v0.1.2
- Add support to authenticate using password
- Add CLI help#### v0.1.1
- Add support to authenticate using `ssh-agent`
#### v0.1.0
- First release