Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszgasior committed Jun 23, 2024
1 parent 3944d7c commit 79136d7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,51 @@ This tool automates that process, making branch management much simpler and more
While it is possible to achieve the same result with a simple script, I have recently fallen in love with Golang.
Therefore, I decided to take this opportunity to create Remove Branches CLI in Golang.

## Installation

Download the app from the Releases page and add it to you $PATH folder.
Installation script will be provided soon.

## Usage

After installing the tool, you can use it with the following commands:

### Display branches to be removed

To display local branches that no longer exist on the remote repository, run:

```sh
git remove-branches
```

### Remove branches with -d flag

To remove local branches that no longer exist on the remote repository using the -d flag, run:

```sh
git remove-branches --prune
```

### Force remove branches with -D flag

To force remove local branches that no longer exist on the remote repository using the -D flag, run:

```sh
git remove-branches --prune --force
```

## How to build it locally?

Just run:
`go build -o git-remove-branches . && mv git-remove-branches $GOPATH/bin/`
```sh
go build -o git-remove-branches . && mv git-remove-branches $GOPATH/bin/
```

## Contributing

If you find any issues or have suggestions for improvements, please open an issue or create a pull request on the GitHub repository.

## License

This project is licensed under the MIT License. See the LICENSE file for more details.

27 changes: 27 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
param (
[string]$version = "v0.1.0"
)

$repo = "lukaszgasior/remove-branches"
$binName = "git-remove-branches"
$os = "Windows"
$arch = "x86_64"
$url = "https://github.com/$repo/releases/download/$version/${binName}_${os}_${arch}.zip"

$output = "$env:TEMP\$binName.zip"
$binPath = "$env:ProgramFiles\Git\bin"

Write-Host "Downloading $url"
Invoke-WebRequest -Uri $url -OutFile $output

Write-Host "Extracting $output"
Expand-Archive -Path $output -DestinationPath $env:TEMP

Write-Host "Installing $binName to $binPath"
Move-Item -Path "$env:TEMP\$binName.exe" -Destination $binPath -Force

Write-Host "Cleaning up"
Remove-Item -Path $output

Write-Host "Installation complete"

0 comments on commit 79136d7

Please sign in to comment.