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

Merge pull request #17 from TechWatching/main

Add a command to clean up outdated git branches
This commit is contained in:
Darren Schroeder 2021-02-10 12:55:23 -06:00 committed by GitHub
commit df6502e8eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 }