1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Add a command to clean up outdated git branches

This commit is contained in:
Alexandre Nedelec 2021-02-10 19:45:41 +01:00
parent 84e02d71ea
commit da6d3ccfd9
2 changed files with 18 additions and 0 deletions

14
git/README.md Normal file
View file

@ -0,0 +1,14 @@
# Git Scripts
### Definition
These scripts should be used to demonstrate how combine the power of nushell with git commands.
### Aliases
If you find some of these scripts useful you can add them as aliases in your git config file.
For instance you can create a nushell script in your computer and define in your git config file an alias that call that script:
```
[alias]
bcl = !nu \"D:\\Tools\\gitalias_bcl.nu\"
```

View file

@ -0,0 +1,4 @@
# Script that remove outdated local branches from a git repo
# More information on this article https://www.techwatching.dev/posts/cleaning-git-branches
git branch -vl '*/*' | lines | split column " " BranchName Hash Status --collapse-empty | where Status == '[gone]' | each { git branch -D $it.BranchName }