Skip to content

Instantly share code, notes, and snippets.

@syntext
syntext / git-snapshot.md
Last active September 6, 2025 09:06
Git Alias: Snapshot

Git Alias: Snapshot

A Git alias that creates a snapshot of your current working directory and index as a new branch without altering your current state.

Installation

Run this command to add the alias to your global Git configuration:

git config --global alias.snapshot '!f() { \