Docker Commands Cheatsheet - Online Quick Reference
A searchable list of essential Docker CLI commands for managing containers, images, and volumes. Copy-paste friendly. Always handy.
UD5 Toolkit
Quick reference for the most essential Git commands β search, copy & go
Set the author name for all commits on this machine.
Example git config --global user.name "John Doe"Set the email address for all commits on this machine.
Example git config --global user.email "john@example.com"Initialize a new Git repository in the current directory.
Example cd my-project && git initClone a remote repository to your local machine.
Example git clone https://github.com/user/repo.gitList all Git configuration settings for the current repository.
Example git config --list --show-originStage a specific file for the next commit.
Example git add index.htmlStage all changed files in the current directory for the next commit.
Example git add .Commit staged changes with a descriptive message.
Example git commit -m "Fix login bug"Show the working tree status β staged, unstaged, and untracked files.
Example git status -s (short format)Show unstaged differences between the working tree and the index.
Example git diff HEAD (all changes including staged)Display the commit history of the current branch.
Example git log --oneline -10Remove a file from the working tree and stage the removal.
Example git rm --cached file.log (keep locally)Move or rename a file and stage the change.
Example git mv old-name.js new-name.jsList all local branches. The current branch is highlighted with an asterisk.
Example git branch -a (list all including remote)Create a new branch at the current commit.
Example git branch feature-loginDelete a local branch (only if already merged).
Example git branch -D feature-old (force delete)Switch to an existing branch.
Example git checkout mainCreate a new branch and switch to it immediately.
Example git checkout -b feature-dark-modeSwitch to an existing branch (modern alternative to checkout).
Example git switch mainCreate a new branch and switch to it (modern alternative to checkout -b).
Example git switch -c feature-apiList all remote connections with their URLs.
Example git remote -vAdd a new remote repository connection.
Example git remote add origin https://github.com/user/repo.gitDownload objects and refs from a remote without merging.
Example git fetch originFetch from a remote and merge into the current branch.
Example git pull origin mainPush local commits to a remote branch.
Example git push origin feature-loginPush and set the upstream tracking reference (first push for a new branch).
Example git push -u origin feature-apiRemove a remote connection from the repository.
Example git remote remove upstreamTemporarily save all uncommitted changes and revert to a clean working tree.
Example git stash save "WIP: refactoring auth"Restore the most recently stashed changes and remove them from the stash list.
Example git stash pop stash@{0}List all stashed changesets.
Example git stash list --statApply stashed changes without removing them from the stash list.
Example git stash apply stash@{1}Remove a specific stash from the stash list.
Example git stash drop stash@{0}Remove all stashed entries. This action is irreversible!
Example git stash clearDisplay commit history in a compact one-line-per-commit format.
Example git log --oneline -20Visualize the full commit tree with branch and tag references.
Example git log --graph --all --decorate --onelineShow detailed information about a specific commit.
Example git show HEAD~2Show who last modified each line of a file and when.
Example git blame src/app.js -L 10,30Show a log of all reference updates (HEAD movements). Useful for recovering lost commits.
Example git reflog -10Show differences between two branches.
Example git diff main...feature-loginUnstage a file while keeping its changes in the working directory.
Example git reset index.htmlReset HEAD to a specific commit and discard all changes. Use with caution!
Example git reset --hard HEAD~1Undo the last commit but keep all changes staged.
Example git reset --soft HEAD~1Create a new commit that reverses the changes of a specified commit.
Example git revert abc1234Discard uncommitted changes in a file (modern alternative to checkout --).
Example git restore app.jsUnstage a file without losing its changes (modern alternative to reset).
Example git restore --staged index.htmlRemove all untracked files and directories. Use with caution!
Example git clean -fdn (dry run first!)List all tags in the repository.
Example git tag -l "v2.*"Create a lightweight tag at the current commit.
Example git tag v1.0.0Create an annotated tag with a message (recommended for releases).
Example git tag -a v2.0.0 -m "Release version 2.0.0"Push a specific tag to the remote repository.
Example git push origin v1.0.0Push all local tags to the remote repository.
Example git push origin --tagsDelete a local tag.
Example git tag -d v1.0.0 && git push origin :refs/tags/v1.0.0Merge a branch into the current branch.
Example git merge feature-loginAbort the current merge process and return to the pre-merge state.
Example git merge --abortReapply commits from the current branch on top of another branch.
Example git rebase mainContinue the rebase process after resolving conflicts.
Example git rebase --continueAbort the rebase process and return to the original branch state.
Example git rebase --abortApply the changes from a specific commit to the current branch.
Example git cherry-pick abc1234git reset --soft HEAD~1 β Undo the commit but keep all changes staged.git reset HEAD~1 β Undo the commit and unstage changes (keep them in working directory).git reset --hard HEAD~1 β Completely discard the commit and all changes (use with caution!).git revert HEAD β Create a new commit that reverses the last commit (safer for shared branches).
<<<<<<<, =======, and >>>>>>>. To resolve:git add [file].git commit (or git merge --continue).git merge --abort.
git fetch downloads new data from the remote repository but does not integrate it into your working files. It's safe and lets you inspect changes before merging. git pull is essentially git fetch followed by git merge β it downloads and immediately merges the remote changes into your current branch. Use git fetch when you want to review changes first; use git pull when you're ready to integrate.
git stash temporarily saves uncommitted changes and reverts your working directory to a clean state. Use it when you need to switch branches but aren't ready to commit your current work. Later, restore your changes with git stash pop or git stash apply. Stashes are stored in a stack, and you can have multiple stashes. Use git stash list to see them all.
git rebase moves or reapplies commits from one branch onto another, creating a cleaner, linear commit history. It's preferred over merging when you want to keep the history tidy and avoid unnecessary merge commits. However, avoid rebasing commits that have already been pushed to a shared repository β it rewrites history and can cause problems for collaborators. Use interactive rebase (git rebase -i) to squash, reorder, or edit commits.
git branch -d [branch-name] (safe, only if merged) or git branch -D [branch-name] (force delete).git push origin --delete [branch-name] or git push origin :[branch-name]..gitignore file tells Git which files or directories to ignore in a project. Create a .gitignore file in your repository root and list patterns for files to exclude β such as build outputs, dependency folders (node_modules/), environment files (.env), and OS-specific files (.DS_Store). You can find templates for various languages at github.com/github/gitignore. Files already tracked by Git won't be affected; use git rm --cached [file] to untrack them.
git checkout -b [new-branch-name]. This is a common situation when exploring old commits or tags.
A searchable list of essential Docker CLI commands for managing containers, images, and volumes. Copy-paste friendly. Always handy.
Select multiple languages and tools (Node, Python, Mac, Windows) and generate a combined .gitignore.
Enter a package name and version range to see all satisfying versions from the registry. Understand ^ and ~.
Enter container height and get recommended depths for each layer (drainage rock, charcoal, moss, soil). Build a healthy miniature ecosystem.
Calculate water volume for flushing soil based on pot size. Includes recovery timeline reminders.
Calculate grout needed (lbs or kg) based on tile size, grout joint, and area. Also recommend spacer size. Local estimator.
Calculate how much liquid fertilizer concentrate to add per gallon of water based on desired N concentration.
Select drip speed or running toilet and see gallons wasted per day and annual cost. Fix leaks!
Select a vegetable and see its best companion plants and which to avoid. Visual grid with quick reference. Improve garden yield and health naturally.
Enter pond volume and product concentration to determine safe ml or teaspoon of algaecide.
Determine your ideal daily macronutrient intake based on TDEE, goal, and diet preference. Free nutrition planning tool with local computation.
Calculate how much acid, alkaline buffer, or remineralizer to add to reach target water parameters.
Calculate how much water to change weekly to keep nitrates under control. Based on current nitrate level, desired level, and tank volume.
Based on your calorie goal, get the perfect gram split of proteins, carbs, and fats. Adjust ratios. For fitness and health.
Calculate how much fertilizer to add based on desired NβPβK ppm and water volume. For hydroponics and soil growers.
Enter a CSS value in vw/vh and see the actual pixel size at current viewport. Dynamic resize demo.
Enter any two variables (speed, distance, time) and get the third. Supports mph, km/h, m/s and multiple units. Practical for runners and drivers.
Estimate how much rope you need to restring a djembe and the number of verticals. Get traditional Mali weave instructions.
Learn what water is safe (rain, distilled, low PPM) for pitcher plants and flytraps. Visual PPM scale.
Enter tank volume and recommended dose to find exact ml or capfuls needed. Avoid overdosing fish.
Calculate how much pure ammonia to add to reach 4ppm for a fishless cycle. Safe start guide.
Enter area to calculate how many epoxy floor kits you need. Consider priming coat.
Enter desired pom-pom diameter to estimate yards needed and number of wraps. Quick craft math.
Calculate liquid or tablet dosage for dogs/cats based on weight and prescribed mg/kg. Check your vet's math. Educational, always consult vet.
Enter a date and location to see moonrise/set times and azimuths. Essential for planning moonlit landscapes.
Generate comprehensive HTML meta tags for SEO and social sharing (Open Graph, Twitter Cards). Copy ready-to-use code. Boost your search visibility.
Enter standard dice notation (e.g., 2d8+3, 4d6k3) and see the roll result and individual dice. Must for tabletop RPG.
Use the pH and KH relationship to estimate dissolved CO2 concentration in your planted tank. Reach 30ppm safely for lush plant growth.
Convert between inches of mercury and hectopascals for altimeter setting. Essential for pilots.
Find the optimal TV size for your room or the best viewing distance based on screen size and resolution (1080p, 4K, 8K). Simple THX/SMPTE reference.