git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
--
As a ZSH function:
function gfd() {
| # Delete all local branches that have been deleted on the remote | |
| function gfd() { | |
| git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D | |
| } | |
| # Squash a branch to a single commit and force push it to the remote | |
| function gspf() { | |
| local current_branch=$(git branch --show-current) | |
| [[ "$current_branch" == "main" || "$current_branch" == "master" ]] && { echo "Aborting: You are on main!"; return 1 } |
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
--
As a ZSH function:
function gfd() {
| #!/usr/bin/env node | |
| console.log('Running a gist directly in your terminal via npx? Are you MAD! ;)'); |
| export class SomeAsyncClass { | |
| private _ready: Promise<void>; | |
| private _readyResolver: Function; | |
| constructor() { | |
| this._ready = new Promise(resolve => (this._readyResolver = resolve)); | |
| this.init(); | |
| } | |
| private async init() { |
I hereby claim:
To claim this, I am signing this object: