Results for “Branches & ancestry”
Small, practical examples. Search by task or narrow things down below.
Handle three possible outcomes
JavaScript: Check high, normal and low values with an ordered conditional chain.
JavaScript✓ Tested
Handle three possible outcomes
TypeScript: Check high, normal and low values with an ordered conditional chain.
TypeScript✓ Tested
Handle three possible outcomes
C++: Check high, normal and low values with an ordered conditional chain.
C++✓ Tested
Handle three possible outcomes
C: Check high, normal and low values with an ordered conditional chain.
C✓ Tested
Choose among several numeric ranges
Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.
Bash Scripts✓ Tested
Create and switch to a branch
Start an isolated feature branch from the current commit.
switch✓ Tested
Merge a branch only by fast-forward
Refuse to create an unexpected merge commit.
merge✓ Tested
Narrow a union using typeof
Handle text and numeric values with separate branches.
union✓ Tested
Remove stale remote-tracking references
Git: Fetch with prune removes tracking references for branches no longer present on the remote.
Git✓ 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