Git, GitHub and Claude Code

Everyday Git commands, the GitHub CLI (gh), and Claude Code's slash commands and shortcuts.

Results

Filter by category

    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 log

      git status -sb | git diff [--staged] | git log --oneline --graph

      Repository state, changes and history.

      git status -sb
      git diff --staged
      git log --oneline --graph --decorate -20
      git log -p -- chemin/fichier
    • git add · git commit

      git 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-edit
    • git clone · git init

      git clone <url> [folder] | git init

      Fetches 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 main
    • git stash

      git stash [push -m <msg>] | git stash pop | git stash list

      Sets aside the changes in progress.

      git stash push -m "brouillon" -u
      git stash list
      git stash pop
    • git blame · git bisect

      git blame <file> | git bisect start / good / bad

      Finds 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 reset
    • git switch · git branch

      git 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/recherche
    • git merge · git rebase

      git 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 --abort
    • git cherry-pick

      git cherry-pick <commit>

      Applies a specific commit to the current branch.

      git cherry-pick a1b2c3d
      git cherry-pick -x a1b2c3d
    • git worktree

      git 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 ../hotfix
    • git restore

      git 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.ts
    • git revert

      git 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 reset

      git 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/main
    • git reflog

      git reflog

      Log of HEAD movements: lets you find a 'lost' commit.

      git reflog -20
      git switch -c recuperation HEAD@{3}
    • git clean

      git clean -nd | git clean -fd

      Deletes untracked files.

      git clean -nd
      git clean -fd
    • git fetch · git pull · git push

      git 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-lease
    • git remote · git config

      git remote -v | git config --global user.name|user.email

      Remotes 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 true
    • git tag

      git 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.0
    • gh auth · repo

      gh auth login | gh repo clone|create|view

      Authentication and management of GitHub repositories from the command line.

      gh auth login
      gh repo clone utilisateur/depot
      gh repo view --web
    • gh pr

      gh pr create|list|view|checkout|merge

      Creates and manages pull requests.

      gh pr create --fill
      gh pr list --state open
      gh pr checkout 123
      gh pr merge 123 --squash --delete-branch
    • gh run · workflow

      gh 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=main
    • gh issue · api

      gh 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 | /memory

      Creates a CLAUDE.md for the project; edits the memory files.

      /init
      /memory
    • /model · /config · /status

      /model [model] | /config | /status

      Switches model, opens settings, shows the session state.

      /model
      /config
      /status
    • /permissions · /hooks · /mcp

      /permissions | /hooks | /mcp

      Tool permission rules, event hooks and MCP servers.

      /permissions
      /hooks
      /mcp
    • /review · /cost · /resume

      /review | /cost | /resume

      Code review, token usage, resuming a previous conversation.

      /review
      /cost
      /resume
    • Shortcuts: Esc · Shift+Tab · Ctrl+C · Ctrl+R

      Esc | Shift+Tab | Ctrl+C | Ctrl+R

      Esc 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 push
    • claude (CLI) : -p · --continue · --resume

      claude [-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 commands

      CLAUDE.md | .claude/settings.json | .claude/commands/<name>.md

      CLAUDE.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

    Search