Git, GitHub and Claude Code
Everyday Git commands, the GitHub CLI (gh), and Claude Code's slash commands and shortcuts.
Results
Commands that rewrite history (reset --hard, rebase, push --force) can lose work: prefer revert and --force-with-lease. Claude Code slash commands evolve: /help lists those in your version.
Full list
Show all 30 entries
git status · git diff · git loggit status -sb | git diff [--staged] | git log --oneline --graphRepository state, changes and history.
git status -sb git diff --staged git log --oneline --graph --decorate -20 git log -p -- chemin/fichiergit add · git commitgit add <files> | git commit -m <message>Stages, then records a change.
git add -p git commit -m "fix(web): corrige le lien du pied de page" git commit --amend --no-editgit clone · git initgit clone <url> [folder] | git initFetches a repository or creates one.
git clone https://github.com/utilisateur/depot.git git clone --depth 1 https://github.com/utilisateur/depot.git git init -b maingit stashgit stash [push -m <msg>] | git stash pop | git stash listSets aside the changes in progress.
git stash push -m "brouillon" -u git stash list git stash popgit blame · git bisectgit blame <file> | git bisect start / good / badFinds who changed a line, or the commit that introduced a bug.
git blame -L 10,30 src/app.ts git bisect start; git bisect bad; git bisect good v1.2.0 git bisect resetgit switch · git branchgit switch [-c] <branch> | git branch [-d|-D] <branch>Switches, creates, lists and deletes branches (replaces git checkout for this use).
git switch -c feat/recherche git branch -vv git branch -d feat/recherchegit merge · git rebasegit merge <branch> | git rebase <base>Brings the commits of one branch into another.
git merge --no-ff feat/recherche git rebase origin/main git rebase --abortgit cherry-pickgit cherry-pick <commit>Applies a specific commit to the current branch.
git cherry-pick a1b2c3d git cherry-pick -x a1b2c3dgit worktreegit worktree add <folder> <branch>Works on several branches in parallel in separate folders, without stashing.
git worktree add ../hotfix hotfix/urgence git worktree list git worktree remove ../hotfixgit restoregit restore [--staged] <file>Discards a file's changes (or unstages it).
git restore src/app.ts git restore --staged src/app.ts git restore --source=HEAD~2 src/app.tsgit revertgit revert <commit>Undoes a commit by creating a new one, without rewriting history (safe after a push).
git revert HEAD git revert -m 1 <commit-de-fusion>git resetgit reset [--soft|--mixed|--hard] <commit>Moves the current branch to another commit.
git reset --soft HEAD~1 git reset HEAD~1 git reset --hard origin/maingit refloggit reflogLog of HEAD movements: lets you find a 'lost' commit.
git reflog -20 git switch -c recuperation HEAD@{3}git cleangit clean -nd | git clean -fdDeletes untracked files.
git clean -nd git clean -fdgit fetch · git pull · git pushgit fetch [--prune] | git pull --rebase | git push [-u origin <branche>]Syncs with the remote repository.
git fetch --prune git pull --rebase git push -u origin feat/recherche git push --force-with-leasegit remote · git configgit remote -v | git config --global user.name|user.emailRemotes and configuration.
git remote -v git remote set-url origin git@github.com:utilisateur/depot.git git config --global user.name "Prénom Nom" git config --global pull.rebase truegit taggit tag [-a] <name> | git push origin <name>Marks a release.
git tag -a v1.2.0 -m "Version 1.2.0" git push origin v1.2.0 git tag -d v1.2.0 && git push origin :refs/tags/v1.2.0gh auth · repogh auth login | gh repo clone|create|viewAuthentication and management of GitHub repositories from the command line.
gh auth login gh repo clone utilisateur/depot gh repo view --webgh prgh pr create|list|view|checkout|mergeCreates and manages pull requests.
gh pr create --fill gh pr list --state open gh pr checkout 123 gh pr merge 123 --squash --delete-branchgh run · workflowgh run list | gh run view <id> --log-failed | gh workflow run <name>Follows and reruns GitHub Actions workflows.
gh run list --limit 5 gh run watch gh run view --log-failed gh workflow run deploy.yml -f ref=maingh issue · apigh issue create|list | gh api <route>Issues and direct calls to the GitHub API.
gh issue create --title "Bug" --body "Description" gh issue list --assignee @me gh api repos/{owner}/{repo}/releases/latest --jq .tag_name/help · /clear · /compact/help | /clear | /compact [instructions]Help, new conversation, and a summary of the context when it gets long.
/help /clear /compact conserve les décisions d'architecture/init · /memory/init | /memoryCreates a CLAUDE.md for the project; edits the memory files.
/init /memory/model · /config · /status/model [model] | /config | /statusSwitches model, opens settings, shows the session state.
/model /config /status/permissions · /hooks · /mcp/permissions | /hooks | /mcpTool permission rules, event hooks and MCP servers.
/permissions /hooks /mcp/review · /cost · /resume/review | /cost | /resumeCode review, token usage, resuming a previous conversation.
/review /cost /resumeShortcuts: Esc · Shift+Tab · Ctrl+C · Ctrl+REsc | Shift+Tab | Ctrl+C | Ctrl+REsc interrupts the current action (Esc twice: go back in the conversation). Shift+Tab switches the permission mode (including plan mode). Ctrl+C cancels. Ctrl+R searches the history.
Input: @ · ! · #@file | !command | # note@ references a file or folder, ! runs a shell command directly, # adds a note to memory.
Explique @src/app.ts ! git status # Toujours lancer pnpm verify avant un pushclaude (CLI) : -p · --continue · --resumeclaude [-p <prompt>] [--continue] [--resume] [--model <m>]Launches Claude Code; -p runs a single prompt and prints the result (non-interactive mode).
claude claude -p "Résume les changements de la dernière semaine" claude --continue claude --resume git diff | claude -p "Relis ce diff"Files: CLAUDE.md · .claude/settings.json · custom commandsCLAUDE.md | .claude/settings.json | .claude/commands/<name>.mdCLAUDE.md holds the project's instructions; settings.json the permissions and hooks; a Markdown file in .claude/commands/ becomes a custom slash command.
.claude/commands/verifier.md -> /verifier