Developer Command Reference
Searchable Git, package manager, and Docker commands — 94 to start, with more added over time.
Git
git initCreate a new Git repository in the current directory.
git clone <url>Copy a remote repository to your machine.
Example: git clone https://github.com/user/repo.git
git config --global user.name "<name>"Set the name attached to your commits, globally for this machine.
git config --global user.email "<email>"Set the email attached to your commits, globally for this machine.
git statusShow which files are staged, modified, or untracked.
git add <file>Stage a file's changes for the next commit.
Example: git add . (stages everything in the current directory)
git commit -m "<message>"Record staged changes as a new commit.
git log --onelineShow commit history, one line per commit.
git diffShow unstaged changes compared to the last commit.
git diff --stagedShow staged changes compared to the last commit.
git branchList local branches. Add a name to create one: git branch <name>.
git checkout -b <name>Create a new branch and switch to it in one step.
git switch <branch>Switch to an existing branch (the modern replacement for git checkout <branch>).
git merge <branch>Merge another branch into the current one.
git rebase <branch>Replay the current branch's commits on top of another branch, for a linear history.
git stashTemporarily shelve uncommitted changes so you can switch branches cleanly.
git stash popRe-apply the most recently stashed changes and remove them from the stash.
git remote add origin <url>Connect a local repository to a remote one for the first time.
git pullFetch and merge changes from the remote branch you're tracking.
git pushUpload local commits to the remote branch you're tracking.
git push -u origin <branch>Push a new branch and set it to track the matching remote branch.
git reset --soft HEAD~1Undo the last commit, keeping its changes staged.
git reset --hard HEAD~1Undo the last commit and discard its changes entirely. Destructive — the changes are not recoverable through normal means.
git revert <commit>Create a new commit that undoes a previous one, without rewriting history — the safe way to undo a commit that's already been pushed.
git cherry-pick <commit>Apply a specific commit from another branch onto the current one.
git tag <name>Mark the current commit with a named tag, commonly used for releases.
git fetchDownload remote changes without merging them into your working branch.
git clean -fdRemove untracked files and directories from the working tree. Destructive and not undoable — review with git clean -nd first.
git log --oneline --graph --allShow a visual graph of all branches and their commit history.
git blame <file>Show who last modified each line of a file, and in which commit.
git worktree add <path> <branch>Check out another branch into a separate working directory, without switching the current one.
git bisect startBinary-search commit history to find which commit introduced a bug. Follow with git bisect bad / git bisect good.
git reflogShow a log of everywhere HEAD has pointed — useful for recovering commits that seem lost after a reset.
git commit --amendRewrite the most recent commit (message and/or staged changes). Avoid on commits already pushed and shared.
git rebase -i HEAD~<n>Interactively edit, squash, or reorder the last n commits before they're shared.
git diff <branch1>..<branch2>Show the differences between two branches.
git show <commit>Show the full details (metadata and diff) of a single commit.
NPM & Yarn
npm init -yCreate a new package.json with default values.
npm installInstall all dependencies listed in package.json.
npm install <package>Add a package as a dependency and install it.
npm install -D <package>Add a package as a dev-only dependency.
npm run <script>Run a script defined in package.json's "scripts" field.
npm ciInstall dependencies exactly as locked in package-lock.json — faster and stricter than npm install, intended for CI.
npm outdatedList installed packages that have a newer version available.
npm uninstall <package>Remove a package and its entry from package.json.
yarn add <package>Add a package as a dependency (Yarn's equivalent of npm install <package>).
yarn add -D <package>Add a package as a dev-only dependency.
yarn devCommon convention for running a project's dev server script — check package.json's "scripts" for the actual command.
npx <package>Run a package's binary without installing it globally — downloads and runs it once.
pnpm installInstall dependencies with pnpm — faster and more disk-efficient than npm via a shared content-addressable store.
pnpm add <package>Add a package as a dependency with pnpm.
npm list --depth=0List top-level installed dependencies and their resolved versions.
npm auditCheck installed dependencies for known security vulnerabilities.
Docker
docker build -t <name> .Build an image from a Dockerfile in the current directory.
docker run -p 8080:80 <image>Start a container from an image, mapping a host port to a container port.
docker psList running containers. Add -a to include stopped ones.
docker logs -f <container>Stream a running container's logs.
docker exec -it <container> shOpen an interactive shell inside a running container.
docker compose up -dStart all services defined in docker-compose.yml in the background.
docker compose downStop and remove containers, networks, and volumes created by docker compose up.
docker image pruneRemove unused (dangling) images to free up disk space.
docker stop <container>Gracefully stop a running container.
docker rm <container>Remove a stopped container. Add -f to force-remove a running one.
docker imagesList locally stored images.
docker pull <image>Download an image from a registry without running it.
docker system prune -aRemove all unused containers, networks, and images to reclaim disk space. Only removes stopped/unused resources.
Package Managers
composer installInstall PHP dependencies exactly as locked in composer.lock.
composer require <package>Add a PHP package as a dependency and install it.
composer create-project laravel/laravel <name>Scaffold a new Laravel project.
pip install <package>Install a Python package into the current environment.
pip freeze > requirements.txtWrite all installed package versions to a requirements file.
pip install -r requirements.txtInstall every package listed in a requirements file.
python -m venv .venvCreate an isolated Python virtual environment in .venv.
source .venv/bin/activateActivate a virtual environment (macOS/Linux). On Windows: .venv\Scripts\activate.
Linux & Shell
ls -laList all files in the current directory, including hidden ones, with details.
cd <path>Change the current directory. cd .. goes up one level; cd ~ goes to home.
pwdPrint the current working directory's full path.
mkdir -p <path>Create a directory, including any missing parent directories.
rm -rf <path>Remove a file or directory recursively and without confirmation. Destructive and not undoable — double-check the path first.
cp -r <src> <dest>Copy a file or directory (recursively for directories).
mv <src> <dest>Move or rename a file or directory.
chmod +x <file>Make a file executable. Use chmod 644/755 for explicit numeric permissions.
grep -rn "<pattern>" .Recursively search files in the current directory for a pattern, showing line numbers.
find . -name "<pattern>"Search the current directory tree for files matching a name pattern.
curl -s <url>Fetch a URL's response body silently. Add -I for headers only, -X POST for a POST request.
ssh <user>@<host>Open a secure shell session on a remote machine.
scp <file> <user>@<host>:<path>Copy a file to a remote machine over SSH.
tar -czvf <archive>.tar.gz <dir>Create a compressed tar archive of a directory.
tar -xzvf <archive>.tar.gzExtract a gzip-compressed tar archive.
ps aux | grep <name>List running processes and filter by name.
kill -9 <pid>Force-terminate a process by its process ID.
lsof -i :<port>Show which process is listening on a given port.
export <VAR>=<value>Set an environment variable for the current shell session and any child processes.
which <command>Show the full path of the executable that would run for a given command name.
This is a starting reference, not an exhaustive command library — command behavior can vary by version and platform.
Related tools
- JSON FormatterPretty-print JSON locally.
- Base64 Encoder / DecoderEncode and decode Base64 in the browser.
- Regex TesterTest regular expressions and see all matches and groups.
- UUID GeneratorGenerate cryptographically random UUIDs in the browser.
- Unix Timestamp ConverterConvert Unix timestamps to dates and back.
