All Projects → dominikbraun → cleanup

dominikbraun / cleanup

Licence: Apache-2.0 license
Remove gone Git branches with ease.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to cleanup

git-beam-it
Bulk clone Github repositories for a specific user/organisation or team
Stars: ✭ 26 (+23.81%)
Mutual labels:  repository-utilities, repository-management
alkemio
START HERE! Cross project collaboration and shared documentation.
Stars: ✭ 22 (+4.76%)
Mutual labels:  collaboration
CoCreate-dashboard
A simple dashboard component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.
Stars: ✭ 20 (-4.76%)
Mutual labels:  collaboration
climateconnect
The global climate action web platform. 🌏
Stars: ✭ 45 (+114.29%)
Mutual labels:  collaboration
removedupes
Remove Duplicate Messages
Stars: ✭ 52 (+147.62%)
Mutual labels:  cleanup
easyappointments-integrations
📅 Various platform integration packages of Easy!Appointments
Stars: ✭ 29 (+38.1%)
Mutual labels:  collaboration
pouchrobot
An AI robot to collaborate in any open source project on GitHub
Stars: ✭ 39 (+85.71%)
Mutual labels:  collaboration
loli
A pretty CLI to find animes passing images 👉😳👈
Stars: ✭ 17 (-19.05%)
Mutual labels:  cli-tool
javascript-examples
Examples for the Convergence Real-time Collaboration Engine
Stars: ✭ 40 (+90.48%)
Mutual labels:  collaboration
TeleType
Stream or share terminals over the web. Show off mad cli-fu, help a colleague, teach, or troubleshoot. end-to-end encrypted 🛡
Stars: ✭ 83 (+295.24%)
Mutual labels:  collaboration
binsync
A collaborative reversing plugin for cross-decompiler collaboration, built on git.
Stars: ✭ 266 (+1166.67%)
Mutual labels:  collaboration
CO.LAB
An open source repository for the learning materials that are used by the CO.LAB program.
Stars: ✭ 61 (+190.48%)
Mutual labels:  collaboration
cleanup
This tool was built for me and you to help us `cleanup` our folders with just a single command from the terminal.
Stars: ✭ 29 (+38.1%)
Mutual labels:  cleanup
PowerSponse
PowerSponse is a PowerShell module focused on targeted containment and remediation during incident response.
Stars: ✭ 35 (+66.67%)
Mutual labels:  cleanup
goris
This is a CLI tool to search for images with Google Reverse Image Search (goris).
Stars: ✭ 62 (+195.24%)
Mutual labels:  cli-tool
awesome-dj
List of reasons why django is awesome for web development & django bootstrap boilerplate
Stars: ✭ 19 (-9.52%)
Mutual labels:  collaboration
open-source-contracting
Providing example language for contracts which work with open-source software and explicitly want to encourage it's growth and development.
Stars: ✭ 44 (+109.52%)
Mutual labels:  collaboration
SeLite
Automated database-enabled navigation ✔️ of web applications
Stars: ✭ 34 (+61.9%)
Mutual labels:  collaboration
vulyk
Flask/Mongo application to provide intuitive web-interface for tasks distribution
Stars: ✭ 35 (+66.67%)
Mutual labels:  collaboration
git-team
Command line interface for managing and enhancing git commit messages with co-authors.
Stars: ✭ 44 (+109.52%)
Mutual labels:  collaboration





cleanup – Remove gone Git branches with ease.





💫 cleanup is a CLI tool for keeping your Git repositories clean. It removes old branches in one or more repositories with a single command.

Project status: In active development. Can be used without warranty.

Quick example

You merely need to provide the path to your repository. For example, change into your project directory and remove all gone branches like this:

$ cleanup branches .

If you want to get a preview of branches that will be deleted, just perform a dry run.

$ cleanup branches --dry-run .

There appear some branches that probably shouldn't be deleted? You can simply exclude them:

$ cleanup branches --exclude="feature/3, feature/4" .

Deleting branches that match a custom search term

--where allows you to specify a string that has to be included in a branch's git branch -vv output. This option overrides the default filter for gone branches, meaning that also non-gone branches will be deleted.

For example, deleting all feature branches is as simple as:

$ cleanup branches --where="feature/" .

In case you want to delete only gone feature branches, extend the default filter for gone branches with --and-where.

$ cleanup branches --and-where="feature/" .

Cleaning multiple repositories at once

Most developers work on multiple projects at once. Let's assume that these projects have a common parent directory.

Deleting gone branches in all of these repositories is fairly simple:

$ cleanup branches --has-multiple-repos projects

What cleanup does

To find out which branches are gone on the remote, cleanup uses the output of git branch -vv.

$ git branch -vv
* master	34a234a [origin/master] Merged some features
  feature/1	34a234a [origin/feature/1: gone] Implemented endpoints
  feature/2	3fc2e37 [origin/feature/2: gone] Added CLI flags

Based on that output, cleanup performs git branch -d <branch> on all gone branches. Maybe you've been doing the same thing manually for each branch in each repository. However, the --where flag allows you to specify a custom string that has to be included to delete the branch.

Installation

Download the latest release of cleanup.

Linux/macOS

Copy the downloaded binary into a directory like /usr/local/bin. Make sure the directory is listed in PATH.

Windows

Create a directory like C:\Program Files\cleanup and copy the executable into it. Add the directory to Path.

Remove branches periodically

Especially developers working in larger teams may want to clean up their repositories periodically.

Linux/macOS

Edit cron's job table.

$ crontab -e

Adding a line like this will run cleanup every day at 11 PM for all repositories. Make sure you provide correct paths to the cleanup binary and project directory.

0 23 * * * /usr/local/bin/cleanup branches --has-multiple-repos /home/user/projects

Windows

Just create a scheduled task like this – and make sure to provide correct paths for the cleanup executable and project directory.

> SCHTASKS /CREATE /SC DAILY /ST 23:00 /TN "Clean up repositories" ^
  /TR "C:\Path\To\cleanup.exe branches --has-multiple-repos C:\Path\To\Projects"


クリーン

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].