FIND YOUR NEXT FEW LINES

Results for “Branches & ancestry”

Small, practical examples. Search by task or narrow things down below.

35 snippets foundClear filters
JavaScriptGetting Started

Handle three possible outcomes

JavaScript: Check high, normal and low values with an ordered conditional chain.

JavaScript✓ Tested
TypeScriptGetting Started

Handle three possible outcomes

TypeScript: Check high, normal and low values with an ordered conditional chain.

TypeScript✓ Tested
C++Getting Started

Handle three possible outcomes

C++: Check high, normal and low values with an ordered conditional chain.

C++✓ Tested
CGetting Started

Handle three possible outcomes

C: Check high, normal and low values with an ordered conditional chain.

C✓ Tested
Bash ScriptsArguments & decisions

Choose among several numeric ranges

Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.

Bash Scripts✓ Tested
GitBranches & recovery

Create and switch to a branch

Start an isolated feature branch from the current commit.

switch✓ Tested
GitBranches & recovery

Merge a branch only by fast-forward

Refuse to create an unexpected merge commit.

merge✓ Tested
TypeScriptTypes & functions

Narrow a union using typeof

Handle text and numeric values with separate branches.

union✓ Tested
GitRemotes & additional checkouts

Remove stale remote-tracking references

Git: Fetch with prune removes tracking references for branches no longer present on the remote.

Git✓ Tested
GitBranches & recovery

Temporarily store tracked-file edits

Restore a clean working tree and then reapply your saved changes.

stash✓ Tested
GitBranches & recovery

Undo a commit with a new commit

Reverse a change while preserving shared history.

revert✓ Tested