Skip to content

Instantly share code, notes, and snippets.

View Norfeldt's full-sized avatar

Lasse Nørfeldt Norfeldt

View GitHub Profile
@Norfeldt
Norfeldt / setup-worktree.sh
Last active January 22, 2026 19:09 — forked from NorfeldtKnowit/setup-worktree.sh
Git worktree setup script with dependency syncing
#!/bin/bash
# Git Worktree Setup Script
# Creates a new git worktree and optionally syncs dependencies from the main repo.
# Useful for working on multiple branches simultaneously without re-installing dependencies.
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
@Norfeldt
Norfeldt / git-cleanup
Created August 5, 2020 08:12 — forked from nook-ru/git-cleanup
Clean up old git branches
#!/bin/bash
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v 'master$' | grep -v 'dev$' | xargs git branch -d