Each deletes a step: four commands, a branch switch, or a commit you did not mean.

Prune on fetch Link to this section

--prune drops local refs to remote branches deleted upstream:

git fetch --prune

Stale refs accumulate with branch churn; git branch -a --contains <commit> gets verbose and slow.

Merge or rebase without checking out the target Link to this section

A fetch already placed the remote’s refs locally as origin/…, and a branch is just a commit reference — no checkout, pull or checkout-back:

git fetch --prune
git merge origin/branch-to-merge-from

The prefix follows the remote name; origin is only the default.

Trigger a pipeline with an empty commit Link to this section

Instead of appending blank lines to poke CI:

git commit --allow-empty -m 'Empty commit'
git push

Read a file from another branch Link to this section

git show main:src/Program.cs
git show HEAD~1:src/Program.cs     # any ref works, not just a branch

No branch switch, no web UI.

Back to the previous branch Link to this section

git checkout develop
git checkout main
git checkout -            # develop again

Search the whole history Link to this section

git rev-list --all | xargs git grep "git"

git rev-list --all feeds every commit to git grep, so matches survive even where the line was later deleted — the search alias in the aliases note.

Log as a graph Link to this section

git log --graph --oneline
git log --graph --oneline systemcontext.md    # one file

--oneline keeps hash and message on one line, making the graph readable at terminal width.