A script to prune local git branches that are no longer needed
- git
- bash
There are multiple possibilities to install this.
Just download the script gitPruneBranches.sh from this repo, make it executable and use it:
./gitPruneBranches.sh
# or
../path/to/gitPruneBranches.sh
# or
/path/to/gitPruneBranches.sh
# orYou may also put it into your PATH, allowing to just execute it with gitPruneBranches.sh.
You can also rename the script to git-pruneBranches and put it into your PATH.
Then you can run it with git pruneBranches.
This repo is also a nix flake and thus can be installed with e.g.
nix shell github:neumantm/gitPruneBranchesThen you can use it with git pruneBranches.
When including it in another flake (e.g. your NixOS configuration) it is advisable to reuse the nixpkgs flake you are already using:
{
inputs.nixpkgs.url = "...";
inputs.gitPruneBranches.url = "github:neumantm/gitPruneBranches";
inputs.gitPruneBranches.inputs.nixpkgs.follows = "nixpkgs";
...
}