https://github.com/fhopfensperger/git-remote-cleanup
A tool to delete no longer needed release branches from a remote repository.
https://github.com/fhopfensperger/git-remote-cleanup
git semver
Last synced: 5 months ago
JSON representation
A tool to delete no longer needed release branches from a remote repository.
- Host: GitHub
- URL: https://github.com/fhopfensperger/git-remote-cleanup
- Owner: fhopfensperger
- License: apache-2.0
- Created: 2020-08-09T09:09:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2026-01-15T22:00:14.000Z (5 months ago)
- Last Synced: 2026-01-16T01:32:52.002Z (5 months ago)
- Topics: git, semver
- Language: Go
- Homepage:
- Size: 404 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# git-remote-cleanup

[](https://goreportcard.com/report/github.com/fhopfensperger/git-remote-cleanup)
[](https://coveralls.io/github/fhopfensperger/git-remote-cleanup?branch=master)
[](https://github.com//fhopfensperger/git-remote-cleanup/releases/latest)
Get and delete no longer needed release branches from a remote repository.
# Usage
## All commands and flags
```bash
Available Commands:
branches Get remote branches
delete Delete old branches, keeps every latest patch version
help Help about any command
Flags:
-f, --file string Uses repos from file (one repo per line)
-b, --filter string Which branches should be filtered e.g. release
-h, --help help for git-remote-cleanup
-p, --pat string Use a Git Personal Access Token instead of the default private certificate! You could also set a environment variable. "export PAT=123456789"
-r, --repos strings Git Repo urls e.g. git@github.com:fhopfensperger/my-repo.git
-v, --version version for git-remote-cleanup
```
Note: All flags can be set using environment variables, for example:
```bash
export REPOS=git@github.com:fhopfensperger/my-repo.git
export PAT=1234567890abcdef
...
```
# Installation
## Homebrew
```bash
brew install fhopfensperger/tap/git-remote-cleanup
```
## Script
```bash
curl https://raw.githubusercontent.com/fhopfensperger/git-remote-cleanup/master/get.sh | bash
```
## Manually
Go to [Releases](https://github.com/fhopfensperger/git-remote-cleanup/releases) download the latest release according to your processor architecture and operating system, then unarchive and copy it to the right location
```bash
tar xvfz git-remote-cleanup_x.x.x_darwin_amd64.tar.gz
cd git-remote-cleanup_x.x.x_darwin_amd64
chmod +x git-remote-cleanup
sudo mv git-remote-cleanup /usr/local/bin/
```
## Run as container
Besides installing the binary on the local computer, you have the option to run the program as a container
```bash
# Using a single repo
docker run -it --rm ghcr.io/fhopfensperger/git-remote-cleanup branches -r https://github.com/fhopfensperger/git-remote-cleanup.git -b master -p 123
# Using a file to define multiple repos
docker run -it --rm -v $(pwd)/repos_http.txt:/app/repos_http.txt ghcr.io/fhopfensperger/git-remote-cleanup branches -f repos_http.txt -b master -p 123
```