Repository status
git statusSee staged, unstaged and untracked changes.
$ help --commands --workflows
Search individual commands or complete, copy-ready workflows. Understand every step before you run it.
git statusSee staged, unstaged and untracked changes.
git initTurn the current folder into a Git repository.
git clone <url>Download a remote repository and its history.
git add <file>Stage a specific file.
git add -AStage new, modified and deleted files.
git add -pChoose individual hunks to stage.
git commit -m "message"Create a commit from the index.
git commit --amend -m "new message"Change the latest commit without creating another one.
git commit --amend --no-editAdd forgotten changes to the previous commit.
git log --oneline --graph --decorate --allInspect commits in a compact graph.
git show <commit>Inspect one commit and its patch.
git log --all --grep="keyword"Find commits by message text.
git blame <file>See who last changed each line.
git branch <name>Create a branch without switching.
git switch -c <name>Create a branch and move to it.
git switch <name>Move to an existing branch.
git branch -m <new-name>Rename the checked-out branch.
git branch -d <name>Delete a local branch after merging.
git branch -D <name>Delete a local branch even if unmerged.
git branchShow local branches.
git branch -rShow remote-tracking branches.
git branch -aShow local and remote branches.
git remote add origin <url>Connect the repo to a remote named origin.
git remote set-url origin <url>Replace the URL used by origin.
git remote add upstream <url>Add a second remote such as upstream.
git remote rename <old> <new>Rename a remote.
git remote remove <name>Remove a remote reference locally.
git remote -vShow remote names and URLs.
git fetch --all --pruneDownload remote refs without merging.
git fetch <remote>Download refs from one remote.
git pull --rebaseUpdate the current branch using rebase.
git push -u origin <branch>Push a branch and set its upstream.
git pushPush the current branch to its upstream.
git push origin --delete <branch>Delete a branch from a remote.
git push --force-with-leaseForce push while refusing non-fast-forward overwrites.
git restore --staged <file>Remove a file from the staging area but keep changes.
git restore <file>Restore a tracked file to HEAD. Destructive.
git restore --source <commit> -- <file>Restore one file from another commit.
git reset --soft HEAD~1Move HEAD back while keeping changes staged.
git reset HEAD~1Move HEAD back and leave edits unstaged.
git reset --hard HEAD~1Hard reset to the previous commit. Destructive.
git stash push -m "work in progress"Temporarily store working-tree changes.
git stash listSee saved stashes.
git stash apply stash@{0}Apply a stash and keep it in the stash list.
git stash popApply and remove the latest stash.
git stash drop stash@{0}Remove a stash.
git tag v1.0.0Create a lightweight tag.
git tag -a v1.0.0 -m "v1.0.0"Create a signed-off annotated release tag.
git push origin v1.0.0Push one tag to origin.
git push origin --tagsPush every local tag.
git tag -d v1.0.0Delete a local tag.
git push origin --delete v1.0.0Delete a tag from origin.
git cherry-pick <commit>Copy one commit onto the current branch.
git cherry-pick --continueContinue after resolving a cherry-pick conflict.
git cherry-pick --abortCancel an in-progress cherry-pick.
git merge <branch>Merge another branch into the current branch.
git merge --abortCancel an in-progress merge.
git rebase <base>Replay current commits on top of another branch.
git rebase -i HEAD~<n>Edit, reorder, squash or drop recent commits.
git rebase --continueContinue after resolving rebase conflicts.
git rebase --abortCancel an in-progress rebase.
git reflogFind previous HEAD positions, useful after reset/rebase.
git switch -c recovery <reflog-sha>Recreate a branch at a previous reflog entry.
git bisect startBinary-search history for the commit that introduced a bug.
echo "<pattern>" >> .gitignoreAppend a path to .gitignore.
git rm --cached <file>Stop tracking a file without deleting it locally.
git clean -fdn && git clean -fdPreview then remove untracked files. Destructive.
git config --global user.name "Your Name"Configure the author name for commits.
git config --global user.email "you@example.com"Configure the author email for commits.
git commit -S -m "message"Create a signed commit when signing is configured.
git worktree add ../feature feature/nameCheck out another branch in a separate directory.
git worktree remove ../featureRemove a linked worktree.
GIT_AUTHOR_DATE="2026-01-15T10:00:00+05:30" GIT_COMMITTER_DATE="2026-01-15T10:00:00+05:30" git commit -m "message"Create a commit with an explicit author and committer date. Use only for legitimate historical/import workflows; the date is metadata, not proof of when work happened.
GIT_COMMITTER_DATE="2026-01-15T10:00:00+05:30" git commit --amend --no-edit --date="2026-01-15T10:00:00+05:30"Change the latest commit metadata while preserving its message.
pwdShow the current path.
ls -laList files in the current directory.
cd <directory>Move into a directory.
cd ..Move to the parent directory.
mkdir -p <path>Create a directory.
touch <file>Create an empty file.
cp <source> <destination>Copy a file.
mv <source> <destination>Move or rename a file.
rm <file>Delete a file.
rm -rf <directory>Delete a directory recursively. Destructive.
grep -Rni "text" .Search recursively inside files.
find . -name "*.log"Find files by name.
cat <file>Print a file to the terminal.
tail -f <file>Watch a file grow in real time.
df -hSee filesystem space usage.
du -sh <directory>See how much space a directory uses.
chmod +x <script>Add execute permission.
./script.shExecute a shell script.
export NAME=valueSet an environment variable for the current shell.
ps auxInspect running processes.
kill <pid>Stop a process by PID.
sudo lsof -i :3000Find the process listening on a port.
tar -czf archive.tar.gz <directory>Create a compressed tar archive.
tar -xzf archive.tar.gzExtract a tar.gz archive.
docker psShow running Docker containers.
docker ps -aShow running and stopped containers.
docker build -t <name>:<tag> .Build an image from a Dockerfile.
docker run --name <name> -p 3000:3000 <image>Start a container and publish a port.
docker stop <container>Stop a running container.
docker rm <container>Remove a stopped container.
docker imagesList local Docker images.
docker rmi <image>Remove a Docker image.
docker exec -it <container> shOpen a shell inside a running container.
docker logs -f <container>Follow container logs.
docker compose up -d --buildBuild and start Compose services in background.
docker compose downStop and remove Compose resources.
docker compose logs -fFollow logs for Compose services.
docker system pruneRemove unused Docker resources. Destructive.
kubectl get podsList pods in the current namespace.
kubectl get pods -AList pods across namespaces.
kubectl get svcList Kubernetes services.
kubectl get deployList deployments.
kubectl describe <resource> <name>Inspect a resource and events.
kubectl logs <pod>Read pod logs.
kubectl logs -f <pod>Stream pod logs.
kubectl exec -it <pod> -- shOpen a shell inside a pod.
kubectl apply -f app.yamlCreate or update resources from YAML.
kubectl delete -f app.yamlDelete resources defined by YAML.
kubectl port-forward svc/<service> 8080:80Forward a local port to a pod/service.
kubectl config current-contextShow the active cluster context.
kubectl config use-context <context>Switch Kubernetes context.
kubectl rollout status deployment/<name>Watch a deployment rollout.
kubectl rollout restart deployment/<name>Restart all pods in a deployment.
gh auth loginAuthenticate GitHub CLI.
gh repo clone owner/repoClone a GitHub repository.
gh repo create <name> --publicCreate a repository from the CLI.
gh repo view --webView repository information.
gh pr listList pull requests.
gh pr createCreate a pull request.
gh pr checkout <number>Checkout a pull request locally.
gh pr view <number> --webOpen a pull request in the browser.
gh pr merge <number>Merge a pull request from the CLI.
gh issue listList repository issues.
gh issue createCreate an issue.
gh workflow run <workflow.yml>Manually dispatch a GitHub Actions workflow.
gh run watchWatch a GitHub Actions run.
npm installInstall package.json dependencies.
npm ciInstall exactly from the lockfile.
npm run devRun the project's dev script.
npm run <script>Run a package.json script.
npm install <package>Add a dependency.
npm install -D <package>Add a development dependency.
npm uninstall <package>Remove a dependency.
npm outdatedFind outdated packages.
npm updateUpdate packages within package.json ranges.
npx <package> <args>Run a package without installing it globally.
python -m venv .venvCreate a Python virtual environment.
..venvScriptsActivate.ps1Activate a venv in Windows PowerShell.
source .venv/bin/activateActivate a venv in bash/zsh.
python -m pip install <package>Install a Python package.
python -m pip freeze > requirements.txtWrite installed packages to requirements.txt.
python -m pip install -r requirements.txtInstall dependencies from requirements.txt.
python -m <module>Run a Python module as a script.
uvicorn main:app --reloadRun a FastAPI app with Uvicorn.
ssh user@hostOpen an SSH session.
ssh -i ~/.ssh/id_ed25519 user@hostConnect using a private key.
scp <file> user@host:/path/Upload a file over SSH.
scp user@host:/path/file .Download a file over SSH.
ssh-keygen -t ed25519 -C "you@example.com"Create an Ed25519 key pair.
curl -I https://example.comInspect response headers.
curl -s https://api.example.com/dataFetch a URL.
nslookup example.comInspect DNS records.
ping example.comCheck basic network reachability.
nc -vz host 443Test a TCP port.
ip routeInspect the local routing table.
ip addrInspect network interfaces and addresses.
psql "$DATABASE_URL"Open a psql session.
\lList PostgreSQL databases.
\dtList tables in the current database.
pg_dump "$DATABASE_URL" > backup.sqlCreate a PostgreSQL backup.
psql "$DATABASE_URL" < backup.sqlRestore a SQL dump.
vercelDeploy the current project.
vercel --prodDeploy to production.
vercel lsShow recent deployments.
vercel env pull .env.localDownload environment variables for a target.