All tags
Start here · gitLet git bisect find the commit that broke your code5 steps · 3 min read · Developers with a bug that appeared sometimeStart the guide git
Narrow down
Guides1
Git157
- Tip
git show-branch main featuregit show-branch shows which commits sit on which branchShows in one table which commits are on which branch since they split.3 Dec 2026 - Tip
git log --stat -5git log --stat shows which files each commit touchedList commits together with a per-file summary of what changed3 Dec 2026 - Tip
git merge --no-ff feature -m "Merge feature"git merge --no-ff keeps a merge commit even when Git could fast-forwardAlways creates a merge commit, so a finished feature branch stays visible as a group in the history.3 Dec 2026 - Tip
git merge --squash featuregit merge --squash turns a whole branch into one staged changeApplies all changes of a branch to your working tree without committing, so you can record them as one commit.3 Dec 2026 - Tip
git merge --abortgit merge --abort gets you out of a merge that ended in conflictsCancels a merge that stopped on conflicts and puts the branch back the way it was before.3 Dec 2026 - Tip
git branch --edit-description [<branch-name>]git branch --edit-description stores a note about what a branch is forSaves a free-text description for a branch, so you remember later what it was meant to do.3 Dec 2026 - Tip
gh pr diff 123 --exclude '*.lock'gh pr diff --exclude hides lockfiles and generated files from a pull request diffPrints a pull request's diff in the terminal and leaves out files that match a glob.3 Dec 2026 - Tip
gh issue develop 123 --checkoutgh issue develop creates a branch that GitHub links to the issueCreates a branch for an issue on GitHub, linked to the issue, and can check it out locally.3 Dec 2026 - Tip
gh run view 12345 --log-failedgh run view --log-failed prints only the log of the steps that failedShows the log of failed workflow steps in your terminal, without opening the whole run.3 Dec 2026 - Tip
gh secret set -f .envgh secret set -f loads several repository secrets from a dotenv fileSets GitHub Actions secrets from the terminal, one by one or all at once from a .env file.3 Dec 2026 - Tip
concurrency:concurrency with cancel-in-progress stops older workflow runs when you push againMakes a GitHub Actions workflow cancel its older run on the same branch when a new one starts.3 Dec 2026 - Tip
git rev-parse --show-toplevelgit rev-parse --show-toplevel prints the root folder of your repositoryPrints the absolute path of the top folder of the current Git repository, from any subfolder.2 Dec 2026 - Tip
git ls-files --others --exclude-standardgit ls-files --others --exclude-standard lists untracked files, one per linePrints only the new files Git doesn't track yet, skipping everything in .gitignore, as plain paths.2 Dec 2026 - Tip
git difftool --dir-diffgit difftool --dir-diff opens all changed files in one diff windowOpens your visual diff tool once with two folders to compare, instead of once per changed file.2 Dec 2026 - Tip
git merge-base --is-ancestor main featgit merge-base --is-ancestor tells a script if one commit is already in anotherAnswers yes or no through the exit code whether a commit is part of another commit's history.2 Dec 2026 - Tip
git config --get-regexp '^user\.'git config --get-regexp finds settings by a pattern in the keyLists every Git setting whose name matches a pattern, with its value.2 Dec 2026 - Tip
git ls-tree -r --name-only maingit ls-tree -r --name-only lists the files in any commit without checking it outLists every file in a commit or branch as plain paths, without touching your working folder.2 Dec 2026 - Tip
git show-ref --verify --quiet refs/heads/featuregit show-ref --verify --quiet checks if a branch or tag existsTells a script by exit code whether a branch or tag with an exact name exists.2 Dec 2026 - Tip
git commit -C ORIG_HEAD-C reuses an old commit message, author and date includedCommit new content with the message and authorship of an existing commit.1 Dec 2026 - Tip
git commit --fixup=reword:HEAD~1Fixup=reword rewrites an older commit message at your next rebaseQueue a better message for an earlier commit without touching its files.1 Dec 2026 - Tip
git config --global commit.cleanup scissorsCommit.cleanup scissors keeps # lines in your commit messageStop Git from silently dropping message lines that start with a hash.1 Dec 2026 - Tip
git commit -m "Fix login redirect" -m "The old code sent signed-out users to a 404."A second -m starts a new paragraph in your commit messageWrite a subject and a body from the command line without opening an editor.30 Nov 2026 - Tip
git rebase --onto main feature-a feature-bgit rebase with onto moves a branch off another branch it was built onReplants only your own commits onto main when you branched from the wrong branch.30 Nov 2026 - Tip
git grep -n 'API_KEY' $(git rev-list --all)git grep over every commit finds a secret that was ever committedSearches all versions of all files in history, not just the current checkout.30 Nov 2026 - Tip
git push origin --delete feature/logingit push origin with delete removes a branch from the serverDeletes a branch on the remote after it has been merged.30 Nov 2026 - Tip
git stash show -p stash@{1}git stash show -p shows what is inside a stash before you apply itPrints the full diff of a stash, so you know what you are about to bring back.30 Nov 2026 - Tip
git diff -wgit diff -w hides changes that are only whitespaceLeaves out indentation and spacing changes so you can read the real edits.30 Nov 2026 - Tip
git log --oneline main..featuregit log main..feature lists the commits that are not on main yetShows exactly which commits a merge would bring in from your branch.30 Nov 2026 - Tip
git mv readme.md README.mdgit mv renames a file when only the case changes on a MacGets a capitalization change into git on a case insensitive file system like macOS.30 Nov 2026 - Tip
git log --format='%h %an %ar %s' -10git log with your own format string shows exactly the fields you wantBuilds your own log line with placeholders for hash, author, date and subject.30 Nov 2026 - Tip
git rev-list --count HEADgit rev-list with count gives you a commit count for scriptsPrints a single number of commits, useful for build numbers and quick checks.30 Nov 2026 - Tip
git switch feature/exportgit switch with a remote branch name creates the local branch for youChecks out a colleague's branch from the remote with one short command.30 Nov 2026 - Tip
git config --global pager.branch falsePager.branch false stops git branch from opening a pagerPrints short git output straight to the terminal instead of in less.30 Nov 2026 - Tip
git fetch origin main:maingit fetch origin main:main updates main without switching to itFast-forwards your local main from the server while you stay on your feature branch.30 Nov 2026 - Tip
git diff --no-index old.conf new.confgit diff with no-index compares two files outside a repositoryGives you git's colored diff for any two files or folders, even outside a repository.30 Nov 2026 - Tip
git status --ignored -sgit status with ignored shows the files your gitignore hidesLists ignored files next to the usual status, so you see what git is hiding.30 Nov 2026 - Tip
git commit -m "Add export button" \git commit with trailer adds Co-authored-by lines the right wayAdds trailer lines like Co-authored-by to a commit message in the format tools expect.30 Nov 2026 - Tip
git remote set-url origin [email protected]:owner/new-name.gitgit remote set-url points your clone at a moved repositoryChanges where origin points after a rename, a move or a switch to SSH.30 Nov 2026 - Tip
git branch -u origin/maingit branch -u links an existing branch to a remote one, no push neededConnects an existing local branch to a remote branch without pushing anything.30 Nov 2026 - Tip
git config --global push.followTags truePush.followTags sends your release tags along with git pushPushes annotated tags on the commits you push, so release tags never stay local.30 Nov 2026 - Tip
git switch --detach v1.4.0git switch with detach lets you look at an old version without a branchChecks out any tag or commit to test it, without creating or moving a branch.30 Nov 2026 - Tip
git tag --contains a1b2c3dgit tag with contains tells you which releases have a fixLists every tag and branch that includes a given commit.30 Nov 2026 - Tip
git clean -n -d -Xgit clean -X removes only ignored files like build outputDeletes build output and other ignored files while leaving your untracked work alone.30 Nov 2026 - Tip
git diff main -- . ':(exclude)vendor'git log and diff can leave a folder out with an exclude pathspecHides vendored or generated folders from log and diff with a pathspec.30 Nov 2026 - Tip
git rev-list --max-parents=0 HEADgit rev-list with max-parents=0 finds the very first commitPrints the root commit of a repository, without scrolling to the end of the log.30 Nov 2026 - Tip
git log --since="1 week ago" --author="$(git config user.email)" --onelinegit log with a date range and an author is my standup listLists only your own commits from a chosen period, ready to read out in a standup.30 Nov 2026 - Tip
git diff main...featuregit diff with three dots shows only what your branch changedCompares your branch with the point where it left main, so other people's work stays out.30 Nov 2026 - Tip
git cat-file -p HEADgit cat-file -p shows what a commit really is insidePrints the raw content of a commit, tree or blob so you see git's own data.30 Nov 2026 - Tip
git config --global alias.last "log -1 --stat"git aliases turn your long commands into short onesDefines your own git subcommands for commands you type often.30 Nov 2026 - Tip
git branch -m old-name new-namegit branch -m renames a branch, and two pushes rename it on the remoteRenames a branch locally and on the server without losing its commits.30 Nov 2026 - Tip
git diff --dirstat main...HEADgit diff with dirstat shows which folders a change touched mostGives a percentage per folder, so you see where a big change really happened.30 Nov 2026 - Tip
git format-patch origin/main..HEAD -o patches/git format-patch and git am move commits as plain filesExports commits as patch files that keep author, date and message, and applies them elsewhere.30 Nov 2026 - Tip
git diff main@{yesterday} maingit diff main@{yesterday} compares a branch with how it was earlierUses the reflog to compare a branch with its state at an earlier time on your machine.30 Nov 2026 - Tip
git config --global core.quotePath falseCore.quotePath false shows accented file names in git as they areStops git from printing names like café as octal escape codes.30 Nov 2026 - Tip
Force redeployment: onForce redeployment in a Portainer Git stack overwrites your local changesExplains when Portainer redeploys a Git stack and what Force redeployment adds.30 Nov 2026 - Tip
git commit --amend --no-edit --reset-authorgit commit amend with reset-author fixes a commit made with the wrong emailRewrites the author of your last commit with your current name and email.30 Nov 2026 - Tip
git config core.fileMode falseCore.fileMode false makes git ignore permission changesStops git from reporting files as changed when only their executable bit changed.30 Nov 2026 - Tip
git cherry -v maingit cherry -v shows which of your commits are not upstream yetCompares commits by their patch, so cherry-picked copies count as already merged.30 Nov 2026 - Tip
git restore -p src/app.jsgit restore -p throws away only the changes you pickDiscards selected hunks from your working tree and keeps the rest of your edits.30 Nov 2026 - Tip
git log --graph --oneline --allgit log with graph, oneline and all draws your branches in the terminalDraws every branch and merge as a small text graph so you see how they relate.30 Nov 2026 - Tip
git branch -c feature feature-backupgit branch -c copies a branch together with its settingsMakes a copy of a branch that keeps its upstream and other branch config.30 Nov 2026 - Tip
git apply --check wip.patchgit apply with check tests a patch before it touches your filesSaves uncommitted work as a patch file and checks that it applies cleanly elsewhere.30 Nov 2026 - Tip
git add -N src/export.pygit add -N makes a new file show up in git diffRegisters a new file without staging its content, so diffs and add -p see it.30 Nov 2026 - Tip
git bisect new HEADgit bisect with old and new finds when something changed, not just when it brokeUses bisect to find the commit that introduced any change, even a good one.30 Nov 2026 - Tip
git fsck --no-reflog | awk '/dangling commit/ {print $3}'git fsck can find a stash you dropped by accidentRecovers a dropped or cleared stash by looking for dangling commits in the object store.30 Nov 2026 - Tip
git diff HEADgit diff HEAD shows staged and unstaged changes togetherCompares your working tree with the last commit, staged or not.30 Nov 2026 - Tip
git config --global init.defaultBranch mainInit.defaultBranch sets the branch name for every new git repositoryMakes git init start on main, or any name you like, without the hint every time.30 Nov 2026 - Tip
git count-objects -vHgit count-objects -vH shows how big your repository really isReports how much disk space the repository's objects take, in readable units.30 Nov 2026 - Tip
git stash push --keep-indexgit stash with keep-index lets you test only what you stagedHides unstaged edits so you can run tests on exactly what you are about to commit.30 Nov 2026 - Tip
git add -ugit add -u stages edits and deletions but skips new filesStages every change to files git already knows, without picking up untracked files.30 Nov 2026 - Tip
git commit --no-verify -m "WIP: half done export"git commit -n skips the pre-commit hook when you really need toBypasses the pre-commit and commit-msg hooks for one commit.30 Nov 2026 - Tip
git stash branch login-form stash@{0}git stash branch turns a stash into its own branchCreates a branch at the commit where you stashed and applies the stash there.30 Nov 2026 - Tip
git add .gitattributesgit add with renormalize fixes line endings after a .gitattributes changeRe-applies your line ending rules to files that are already in the repository.30 Nov 2026 - Tip
git commit -m "Fix typo in readme" README.mdgit commit with a path commits just that file and ignores the rest of the indexCommits the current version of the files you name, while other staged work stays staged.30 Nov 2026 - Tip
git stash push -m "config experiment" -- src/config.jsgit stash push with a path stashes just one filePuts changes to selected files aside and leaves your other edits in place.30 Nov 2026 - Tip
git config --global tag.sort version:refnameTag.sort version:refname puts git tags in version orderSorts tags as versions, so v1.10 comes after v1.9 instead of before it.30 Nov 2026 - Tip
Alice <[email protected]> <[email protected]>a .mailmap file merges your old git names into oneMaps old names and email addresses to one identity in shortlog and log output.30 Nov 2026 - Tip
/security-review/security-review in Claude Code checks your branch for security holesReviews the diff between your branch and the main branch for injection, auth and data leaks.30 Nov 2026 - Tip
git log --grep="login" -i --onelinegit log with grep searches your commit messages, add -i to ignore caseFinds commits by words in their message instead of by the code they changed.30 Nov 2026 - Tip
git log --oneline --ancestry-path --merges abc1234..maingit log with ancestry-path shows how a commit reached mainFinds the merge that brought a specific commit into a branch.30 Nov 2026 - Tip
/diff/diff shows what Claude changed without leaving Claude CodeOpens a view of the uncommitted changes in your working tree, including Claude's edits.30 Nov 2026 - Tip
git merge-base main featuregit merge-base finds the commit where two branches splitPrints the common ancestor of two branches, handy for diffs, rebases and scripts.30 Nov 2026 - Tip
git commit -m "Stop tracking .env"git rm with cached stops tracking a file but keeps it on diskRemoves a committed file from the repository while leaving your local copy in place.30 Nov 2026 - Tip
git rev-list --left-right --count main...HEADgit rev-list with left-right and count tells you how far ahead or behind you arePrints two numbers: commits only on one branch and commits only on the other.30 Nov 2026 - Tip
git worktree prune -n -vgit worktree prune cleans up worktrees you deleted by handRemoves leftover bookkeeping for worktree folders that no longer exist.30 Nov 2026 - Tip
git config --global gpg.format sshSign your git commits with the SSH key you already haveSigns commits with an SSH key instead of GPG, with three config lines.30 Nov 2026 - Tip
git show v1.0:config/app.phpgit show commit:path prints an old version of a file without a checkoutPrints a file as it was at any commit or tag, without touching your working tree.30 Nov 2026 - Tip
git show ':/fix login'git show :/text picks the newest commit whose message matchesRefers to a commit by words from its message instead of by its hash.30 Nov 2026 - Tip
git checkout --theirs package-lock.jsongit checkout with ours or theirs picks one side of a conflicted fileResolves a whole conflicted file by taking your version or the incoming one.30 Nov 2026 - Tip
git config core.hooksPath .githooksCore.hooksPath lets you keep git hooks in the repositoryPoints git at a hooks folder you commit, so the whole team can share the same hooks.30 Nov 2026 - Tip
git switch --orphan gh-pagesgit switch with orphan starts a branch with no historyCreates an empty branch that shares no commits with the rest of the repository.30 Nov 2026 - Tip
git config --show-origin --listgit config with show-origin tells you which file a setting comes fromShows the file behind every git setting, so you know where to change it.30 Nov 2026 - Tip
git reset --hard ORIG_HEADgit reset with ORIG_HEAD undoes a merge or rebase you just didJumps back to the commit you were on before the last merge, rebase or reset.30 Nov 2026 - Tip
git config --global pull.ff onlyPull.ff only stops git pull from making surprise merge commitsMakes git pull refuse to create a merge commit unless it can simply fast-forward.28 Nov 2026 - Tip
git log --first-parent --oneline maingit log --first-parent shows the main line of historyShows one entry per merge by following only the first parent through the history.28 Nov 2026 - Tip
git update-index --skip-worktree config/local.phpgit update-index --skip-worktree hides a local edit to a tracked fileTells git to treat a tracked file as unchanged so your local edits stop showing up.28 Nov 2026 - Tip
git restore --source=HEAD~3 -- src/settings.phpgit restore --source brings back one file from another commitReplaces one file in your working tree with its version from any other commit.28 Nov 2026 - Tip
git log --diff-filter=D --summary -- path/to/old-file.phpgit log --diff-filter=D finds when a file was deletedLists only the commits that deleted files, so you can find when a file disappeared.28 Nov 2026 - Tip
git config --global column.ui autoColumn.ui auto prints long git lists in columnsPrints git branch and similar lists in columns when the output goes to a terminal.28 Nov 2026 - Tip
git commit --allow-empty -m "Trigger CI"git commit --allow-empty makes a commit with no changesRecords a commit that changes no files, for example to restart a CI run.28 Nov 2026 - Tip
git revert -m 1 <merge-commit>git revert -m 1 undoes a merge commitUndoes a merge commit by telling git which parent counts as the main line.28 Nov 2026 - Tip
git log -G'timeout\s*=' --oneline -p -- config/git log -G finds commits whose changes match a regular expressionFinds commits whose added or removed lines match a regular expression.28 Nov 2026 - Tip
git config --global core.excludesFile ~/.gitignore_globalCore.excludesFile gives git a global ignore list for every repositoryIgnores files like .DS_Store in every repository from one personal file.28 Nov 2026 - Tip
git branch -vvgit branch -vv shows which remote branch each local branch tracksLists local branches with the upstream branch each one tracks and the last commit.28 Nov 2026 - TipCommit.template pre-fills your commit messageStarts every commit message editor with a text of your own, such as a checklist.28 Nov 2026
- Tip
git config --global url."[email protected]:".insteadOf "https://github.com/"Url.insteadOf makes git use ssh for https GitHub addressesRewrites https GitHub URLs to ssh automatically for clone, fetch and submodules.28 Nov 2026 - Tip
git config --global user.email "[email protected]"Use your GitHub noreply address as git user.email to keep your mail address out of commitsPuts GitHub's noreply address in your commits instead of your real email address.28 Nov 2026 - Tip
git rebase --autostash origin/maingit rebase --autostash lets you rebase with a dirty working treeStashes uncommitted changes before a rebase and restores them afterwards.28 Nov 2026 - Tip
git rebase --update-refs maingit rebase --update-refs moves your stacked branches alongRebases a branch and also moves the branches stacked underneath it.28 Nov 2026 - Tip
git config --global merge.conflictStyle zdiff3Merge.conflictStyle zdiff3 shows the common ancestor in conflictsAdds the original text to merge conflicts so you can see what each side changed.28 Nov 2026 - Tip
git diff --diff-algorithm=histogramDiff.algorithm histogram for diffs that read betterSwitches Git's diff algorithm so moved or repetitive code can show up as cleaner hunks.28 Nov 2026 - Tip
git blame -w -C -C -L 40,60 src/config.pygit blame -w -C -C to skip whitespace and find moved codeAttributes lines to the commit that wrote them, ignoring whitespace changes and code moved between files.28 Nov 2026 - Tip
git branch --merged maingit branch --merged to find branches you can deleteLists local branches already merged into main so you can delete them safely.28 Nov 2026 - Tip
git diff --checkgit diff --check catches whitespace errors and conflict markersWarns about trailing whitespace and leftover conflict markers in your changes.28 Nov 2026 - Tip
git rebase --exec "make test" origin/maingit rebase --exec runs a command after every commitRuns a test command on every commit of a branch during a rebase and stops at the first failure.28 Nov 2026 - Tip
"command": "git status --short --branch && git log --oneline -5"A SessionStart hook gives Claude Code your git status before you typeFeeds your branch, changed files and last commits to Claude Code when a session starts.27 Nov 2026 - Tip
git check-ignore -v path/to/filegit check-ignore -v tells you which rule ignores a fileShows which .gitignore file, line and pattern makes git ignore a file.27 Nov 2026 - Tip
git commit -vgit commit -v shows your diff while you write the messageShows the staged diff in your editor while you write the commit message.27 Nov 2026 - Tip
git diff --color-movedgit diff --color-moved shows code that only movedColors moved lines differently in a diff, so real edits stand out during a review.27 Nov 2026 - Tip
name = Your NameIncludeIf gitdir gives your work repositories their own git emailGives every repository under one folder its own git settings, like a work email address.27 Nov 2026 - Tip
git archive --format=tar.gz --prefix=project/ -o project.tar.gz HEADgit archive makes a clean tarball of your project without the .git folderPacks one commit or tag of a repository into a tar.gz or zip file, without history.26 Nov 2026 - Tip
git bundle create backup.bundle --allgit bundle puts a whole repository in one file you can clone fromPacks all branches and tags of a repo into one file for offline transfer or backup.26 Nov 2026 - Tip
git notes add -m 'Tested on Debian 13' 72a144e2git notes adds a remark to a commit without changing the commitAttaches extra text to an existing commit, shown in git log, without rewriting history.26 Nov 2026 - Tip
git sparse-checkout set docs tools/scriptsgit sparse-checkout set gives you only the folders you need from a big repoChecks out only chosen folders of a large Git repository, so the working tree stays small.26 Nov 2026 - Tip
git grep -n -p TODOgit grep -p shows which function a match lives inSearches only the files git tracks and names the function around every match.25 Nov 2026 - Tip
git range-diff @{u} @{1} @git range-diff shows what a rebase changedCompares two versions of a branch commit by commit, for example before and after a rebase.25 Nov 2026 - Tip
git branch --show-currentgit branch --show-current prints only the name of your branchPrints the name of the current branch and nothing else, which is handy in scripts and prompts.25 Nov 2026 - Tip
git diff --name-only main...HEADgit diff --name-status lists changed files with a letter for what happenedLists only the files that changed, either as plain names or with a status letter for added, modified or deleted.25 Nov 2026 - Tip
git describe --tagsgit describe --tags names a commit after the nearest tagGives a commit a readable name made of the closest tag and the number of commits since it.25 Nov 2026 - Tip
git reset --soft HEAD~1git reset --soft HEAD~1 undoes the last commit but keeps your changesMoves the branch back one commit while the changes stay staged, so you can recommit them differently.25 Nov 2026 - Tip
git show --statgit show --stat summarizes what a commit changedShows a commit message and a list of the changed files with line counts, without the full diff.25 Nov 2026 - Tip
git status -sbgit status -sb shows a compact status with the branch linePrints the changes as short two-letter codes and adds one line with the branch and its upstream.25 Nov 2026 - Tip
git config --global help.autocorrect promptHelp.autocorrect prompt asks before git runs a corrected commandMakes git ask for confirmation when it guesses what you meant after a typo in a command name.24 Nov 2026 - Tip
git tag -ngit tag -n lists your tags with their messagesLists tags together with the first line of their annotation, so the list explains itself.24 Nov 2026 - Tip
git maintenance startgit maintenance start keeps a big repository fast in the backgroundRegisters the repository for scheduled background upkeep like prefetching and commit-graph updates, so it stays fast.24 Nov 2026 - Tip
git stash push -m "login form, half done"git stash push -m gives a stash a name you can find againSaves your unfinished changes under a name, so git stash list tells you what each stash holds.23 Nov 2026 - Tip
git commit --fixup a1b2c3dgit commit --fixup plus --autosquash keeps your history clean without any editing10 Nov 2026 - Tip
git log -L :parseConfig:src/config.jsFollow one function through history with git log -LShows only the commits that changed one function or line range in a file.25 Oct 2026 - Tip
git switch - # back on your feature branchgit switch – takes you back to the branch you were onJumps back to the previous Git branch without typing its name.23 Oct 2026 - Tip
git diff --word-diffRead a small edit in a long line with git diff --word-diffShows changes word by word instead of line by line.12 Oct 2026 - Tip
git clean -n -dPreview what git clean will delete with -nShows which untracked files git clean would remove, without deleting anything.3 Oct 2026 - Tip
git fetch --pruneFetch.prune cleans up branches that no longer exist remotelyRemoves stale remote-tracking branches every time you fetch.24 Sep 2026 - Tip
git branch --sort=-committerdateSort your branches by last commit with branch.sortLists your branches with the most recently committed one at the top.18 Sep 2026 - Tip
git config --global push.autoSetupRemote trueSet push.autoSetupRemote and stop typing --set-upstreamMakes the first push of a new branch set up tracking automatically.13 Sep 2026 - Tip
git config --global rerere.enabled trueTurn on rerere and resolve the same conflict only onceMakes git remember how you resolved a merge conflict and reuse it next time.7 Sep 2026 - Tip
git worktree add ../hotfix hotfixUse git worktree to check out two branches at onceChecks out a second branch in its own folder without stashing or cloning.27 Aug 2026 - Tip
git bisect run ./test.shLet git bisect run your test for youFinds the commit that introduced a bug by running your test script on commits automatically.20 Aug 2026 - Tip
0123456789abcdef0123456789abcdef01234567Tell git blame to ignore a big reformatting commitMakes git blame skip commits like mass reformatting so it shows who really wrote a line.9 Aug 2026 - TipTurn on Re-pull image in a Portainer Git stack so updates really updateMakes a Git-based Portainer stack pull fresh images whenever it redeploys.5 Aug 2026
- Tip
git diff --stagedgit diff --staged shows what your commit will containShows the changes that are staged and will go into your next commit.26 Jul 2026 - Tip
git add -pStage only part of a file with git add -pLets you choose which parts of a file go into the next commit.18 Jul 2026 - Tip
git restore --staged notes.txtUnstage a file with git restore --stagedTakes a file out of the staging area while keeping your edits on disk.13 Jul 2026 - Tip
git push --force-with-leaseUse --force-with-lease, not --forceForces a push only if nobody else has updated the remote branch since you last fetched.5 Jul 2026 - Tip
git add forgotten-file.txtAdd a forgotten file to your last commit with --amend --no-editAdds your staged changes to the previous commit without touching its message.25 Jun 2026 - Tip
git reflogFind lost commits with git reflogLists where your branch tips have been so you can bring back commits after a reset.18 Jun 2026 - Tip
git stash push -u -m "login form, half done"Stash your new files too with git stash -uStashes your changes together with new files that git does not track yet, and labels the stash.9 Jun 2026 - Tip
git switch feature/logingit switch – takes you back to the branch you were just onJumps back to the branch you were on before your last branch switch.3 Jun 2026
Docker2
- Tip
Compose path: docker-compose.ymlAdditional paths in a Portainer Git stack merge extra compose filesLoads a second compose file from the same repository on top of the main one.30 Nov 2026 - TipDetach from Git in Portainer only downloads the main compose fileTurns a Git-based Portainer stack into a normal editable stack, with a few files left behind.15 Aug 2026
AI2
- Tip
// .claude/settings.jsonThe attribution setting controls the Co-Authored-By line Claude Code puts in commitsChanges or removes the attribution text Claude Code adds to commits and pull requests.27 Nov 2026 - Tip
echo "CLAUDE.local.md" >> .gitignorePut personal project notes in CLAUDE.local.md and gitignore itKeeps your own project notes for Claude Code out of the shared CLAUDE.md and out of git.4 Sep 2026
Shell1
Posts1
Nothing matches.