開発支援

Git チートシート

カテゴリ別に整理された Git コマンドを検索し、ブランチ、マージ、rebase、stash などの操作を素早く参照できます。

無料で利用 登録不要 ブラウザ内で実行

ツール操作エリア

Setup & Config

git init

Initialize a new Git repository in the current directory

--bare
git clone <url>

Clone a remote repository to your local machine

--depth 1--branch <name>--recurse-submodules
git config user.name "<name>"

Set the author name for commits

--global--local--list
git config user.email "<email>"

Set the author email for commits

--global--local

Staging & Commits

git add <file>

Stage a file for the next commit

-A-p.
git commit -m "<message>"

Create a commit with a message

--amend--no-edit-a--allow-empty
git status

Show the working tree status

-s--short
git diff

Show unstaged changes

--staged--cached--stat--name-only
git log

Show commit history

--oneline--graph--all-n <number>--author=<name>

Branching & Merging

git branch

List, create, or delete branches

-a-d <branch>-D <branch>-m <new-name>
git checkout <branch>

Switch to a branch or restore files

-b <new-branch>--
git switch <branch>

Switch to a branch (modern alternative to checkout)

-c <new-branch>--detach
git merge <branch>

Merge a branch into the current branch

--no-ff--squash--abort
git rebase <branch>

Reapply commits on top of another branch

-i--onto--abort--continue

Remote

git remote -v

List remote repositories with URLs

add <name> <url>remove <name>rename <old> <new>
git fetch

Download objects and refs from a remote

--all--prune<remote>
git pull

Fetch and integrate changes from a remote branch

--rebase--no-rebase<remote> <branch>
git push

Upload local commits to a remote repository

-u origin <branch>--force--tags--delete <branch>

Stash

git stash

Temporarily save uncommitted changes

-u--include-untracked-m "<message>"
git stash pop

Apply the most recent stash and remove it from the list

git stash list

List all stashed changes

git stash drop

Remove a specific stash entry

stash@{n}
git stash apply

Apply a stash without removing it from the list

stash@{n}

Undo & Reset

git reset <file>

Unstage a file while preserving changes

--soft HEAD~1--mixed HEAD~1--hard HEAD~1
git revert <commit>

Create a new commit that undoes a previous commit

--no-commit-n
git restore <file>

Discard changes in the working directory

--staged--source=<commit>
git clean -fd

Remove untracked files and directories

-n (dry run)-x-i

Inspection

git log --oneline

Show compact commit history (one line per commit)

git log --graph --all

Visualize branch history as a graph

git show <commit>

Display details and diff of a specific commit

git blame <file>

Show who last modified each line of a file

git reflog

Show a log of all reference updates (useful for recovery)

git shortlog -sn

Summarize commit counts by author

Tags

git tag <name>

Create a lightweight tag at the current commit

git tag -a <name> -m "<msg>"

Create an annotated tag with a message

git tag -l

List all tags

"v1.*"
git push origin <tag>

Push a specific tag to a remote

--tags
git tag -d <name>

Delete a local tag

Git チートシートとは?

Git チートシートは、カテゴリ別に整理された Git コマンドを検索し、ブランチ、マージ、rebase、stash などの操作を素早く参照できます。必要な値や定義をすばやく引き当てたいときに役立ち、実装中の確認や資料作成に向いています。最新仕様や環境依存の差異がある場合は、一次資料もあわせて確認してください。

Git チートシートの使い方

  1. 1検索語、拡張子、コード、カテゴリなどで対象を絞り込みます。
  2. 2一覧や候補から必要な項目を選び、詳細や対応関係を確認します。
  3. 3参照値や説明をコピーするか、そのまま仕様確認に使います。

Git チートシートの主な用途

仕様の参照

必要な値や定義を引き当て、実装や設定の根拠をすぐ確認できます。

問い合わせ対応

コードや項目の意味を短時間で説明できます。

資料作成の下準備

README や運用手順へ載せる前に表記や対応関係を確かめられます。

よくある質問

一覧は完全ですか?

これは素早い参照に向いたツールです。最新仕様、独自拡張、ベンダー固有の差分までは別資料が必要な場合があります。

社内コードや固有名を検索するときの注意点はありますか?

実データを扱う前に、ブラウザの保存設定、組織ポリシー、利用環境のログ取得有無を確認してください。必要なら匿名化したサンプルで手順を確かめると安全です。