git-remote-cleanup

command module
v0.3.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

git-remote-cleanup

Go Go Report Card Coverage Status Release

Get and delete no longer needed release branches from a remote repository.

Usage

All commands and flags

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:

export REPOS=git@github.com:fhopfensperger/my-repo.git
export PAT=1234567890abcdef
...

Installation

Homebrew

brew install fhopfensperger/tap/git-remote-cleanup

Script

curl https://raw.githubusercontent.com/fhopfensperger/git-remote-cleanup/master/get.sh | bash

Manually

Go to Releases download the latest release according to your processor architecture and operating system, then unarchive and copy it to the right location

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

# 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

Documentation

Overview

Copyright © 2020 Florian Hopfensperger

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL