Skip to content

Instantly share code, notes, and snippets.

View ian-oneleet's full-sized avatar

Ian ian-oneleet

View GitHub Profile
@ian-oneleet
ian-oneleet / blobify.zsh
Created May 5, 2025 15:12
Generate a Git commit hash to apply staged changes to another branch
# Usage:
# $ blobify [ <commit-args> ]
# # On another branch (perhaps in another worktree)
# $ git cherry-pick <paste-commit-sha-here>
function blobify() {
git commit "$@"
local rev="$(git rev-parse --short HEAD)"
git reset --soft HEAD^
echo "\nBlobified as $rev"
pbcopy <<< "$rev"