Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

git-sweep

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-sweep

Clean up remote branches for git repo

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

git-sweep npm version

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 <remote>/<branch> format. Use comma to delimit multiple branches. This option will be merged with the configuration in .gitsweepignore.

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
    • username/password
    • HTTPS
    • github 2FA
    • Manual ssh key files
  • Filters
    • Merged branch
    • Cutoff date (similar to age)
  • CLI help

License

MIT

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

Keywords

git

FAQs

Package last updated on 28 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts