FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Create and switch to a branch
Start an isolated feature branch from the current commit.
switch✓ Tested
List local branches
Print branch names in sorted order.
branch✓ Tested
Merge a branch only by fast-forward
Refuse to create an unexpected merge commit.
merge✓ Tested
Temporarily store tracked-file edits
Restore a clean working tree and then reapply your saved changes.
stash✓ Tested
Undo a commit with a new commit
Reverse a change while preserving shared history.
revert✓ Tested