ツール ガイド
developer 無料 サインアップ不要

Git コマンドチートシート

カテゴリ別に整理された80以上の必須Gitコマンドの検索・お気に入り機能付きインタラクティブリファレンスです。

ツールを読み込み中…

このツールについて

セットアップ、基本ワークフロー、ブランチ、リモート、元に戻す、スタッシュ、ログ/履歴、アドバンスドのカテゴリに整理された80以上のよく使われるコマンドを網羅したインタラクティブなGitリファレンスです。キーワードでコマンドを検索し、お気に入りにマークしてすぐアクセスでき、コマンドをクリックしてコピーするか詳しい説明を表示できます。

使い方

  1. 1 ステップ1:タブナビゲーションを使用してカテゴリ別にコマンドを閲覧するか、検索ボックスを使用して特定のコマンドを検索してください。
  2. 2 ステップ2:任意のコマンドの横にあるコピーボタンをクリックして、クリップボードに直接コピーしてください。
  3. 3 ステップ3:星アイコンをクリックしてコマンドをお気に入りに登録してください。登録されたコマンドは保存され、お気に入りタブからアクセスできます。
  4. 4 ステップ4:「説明」モードを有効にして任意のコマンドをクリックすると、そのコマンドの詳しい説明、使用例とユースケースが表示されます。

A searchable reference for the commands you keep forgetting

Git has hundreds of commands and flags, but most daily work draws on a few dozen. The trouble is remembering the exact syntax under pressure — the difference between reset --soft and reset --hard, or how to safely undo a push. This cheat sheet collects the commands that matter, organised into the categories you actually think in: Setup, Basic Workflow, Branching, Remote, Undo, Stash, Log/History, and Advanced. Each entry shows the command, a one-line description, and a real example you can copy with a single click.

How to use it: tabs, search, and Explain mode

Three controls make this faster than scrolling a long list. Category tabs jump straight to a group — click "Branching" to see only branch commands. Search matches across both command text and descriptions at once, so typing undo surfaces relevant commands even though the word "undo" is in the description, not the command. And Explain mode is the key feature: tick it, then click any command to expand a paragraph describing what it really does, with its own worked example. That turns the sheet from a list of strings into something that teaches the why, not just the what.

Favorites that persist

Every command has a star. Click it and the command is added to a Favorites tab, and that list is saved in your browser's local storage — so the handful of commands you reach for daily are still there the next time you open the page. There is no account and no sync; the favorites live on your device. The Copy button next to each command puts just the command text on your clipboard and flashes a brief "Copied!" confirmation.

A worked example: undoing your last commit

Suppose you committed too early. Open the Undo tab and you will see three resets that look almost identical but behave very differently — this is exactly where people get burned:

CommandMoves HEAD back?Your changes
git reset --soft HEAD~1YesKept, still staged
git reset --mixed HEAD~1YesKept, unstaged
git reset --hard HEAD~1YesDiscarded permanently

Turn on Explain mode and click git reset --hard HEAD~1: it warns that the change "cannot be undone easily." For undoing a commit you have already pushed, the sheet points you instead to git revert, which creates a new commit that reverses the old one — safe for shared branches because it rewrites no history.

The safety distinctions worth internalising

  • --force versus --force-with-lease. A plain force push can clobber a teammate's work. git push --force-with-lease only succeeds if nobody has pushed since your last fetch — the sheet recommends it for exactly this reason.
  • Reset versus revert. Reset moves history and is fine on local, unpushed commits; revert adds an undo commit and is the right tool once others have your commits.
  • Merge versus rebase. Merge preserves the branch shape with a merge commit; rebase replays your commits for a linear history. The sheet lists both with notes on when each fits.
  • git reflog is your safety net. If a reset loses a commit, reflog shows where HEAD pointed recently so you can recover it — one of the most reassuring commands to know exists.

Beyond the basics

The Advanced tab covers the commands that feel like magic once you meet them: git cherry-pick to lift a single commit onto another branch, git rebase -i to squash and reorder commits before a merge, git bisect to binary-search history for the commit that introduced a bug, and git worktree to check out two branches in two folders at once. The Stash tab covers saving half-finished work out of the way, and Log/History covers reading the past — git log --oneline --graph --all for a visual branch map, git blame to find who last touched a line.

Common mistakes this sheet helps you avoid

  • Reaching for --hard when you meant --soft. Read the Explain text before running a reset you cannot undo.
  • Using commit -am and expecting new files to be included. The note makes clear it only stages already-tracked files, not new untracked ones.
  • Amending or force-pushing shared branches. The entries flag which commands rewrite history and should stay on your local work.

Everything runs in your browser. There is no Git execution here and nothing is sent anywhere — it is a fast, private, copy-ready reference that remembers your favorites between visits.

よくある質問

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}