mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +00:00
Merge pull request #17 from TechWatching/main
Add a command to clean up outdated git branches
This commit is contained in:
commit
df6502e8eb
2 changed files with 18 additions and 0 deletions
14
git/README.md
Normal file
14
git/README.md
Normal 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\"
|
||||
```
|
4
git/git_branchcleanup_.nu
Normal file
4
git/git_branchcleanup_.nu
Normal 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 }
|
Loading…
Add table
Add a link
Reference in a new issue