Git Essential Commands
Common Git commands for everyday version control workflows.
Common Git commands for everyday version control workflows.
Essential git commands with a one-line description: init, clone, add, commit, push, pull, branch, checkout, merge, rebase, stash, log, diff, reset and cherry-pick, extended with status, fetch, restore, switch, tag, blame, bisect, revert, reflog, worktrees and configuration.
| Command | Description |
|---|---|
| git init | Initialize a new Git repository in the current directory. |
| git clone <url> | Clone a remote repository to your local machine. |
| git add <file> | Stage changes for the next commit. Use git add . for all. |
| git commit -m "msg" | Commit staged changes with a descriptive message. |
| git push | Upload local commits to the remote repository. |
| git pull | Fetch and merge changes from the remote branch. |
| git branch -a | List all local and remote branches. |
| git checkout <branch> | Switch to the specified branch. Use -b to create and switch. |
| git merge <branch> | Merge the specified branch into the current branch. |
| git rebase <branch> | Reapply commits on top of another branch. Use with caution on public branches. |
| git stash | Temporarily store uncommitted changes. Use git stash pop to restore. |
| git log --oneline -10 | Show the last 10 commits in compact format. |
| git diff | Show unstaged changes. Use git diff --staged for staged changes. |
| git reset --soft HEAD~1 | Undo the last commit, keeping changes staged. |
| git cherry-pick <hash> | Apply a specific commit by hash onto the current branch. |
| git status | Show changed, staged and untracked files. |
| git fetch | Download remote changes without merging them. |
| git restore <file> | Discard working-tree changes to a file; use --staged to unstage. |
| git switch -c <branch> | Create a new branch and switch to it. |
| git diff --staged | Show changes that are staged for the next commit. |
| git commit --amend | Modify the most recent commit; avoid after pushing. |
| git stash pop | Reapply the most recent stash and remove it from the stash list. |
| git revert <hash> | Create a new commit that undoes an earlier one without rewriting history. |
| git log --graph --oneline --all | Show a compact graph of all branches. |
| git blame <file> | Show who last changed each line of a file. |
| git bisect start | Begin a binary search through history to find the commit that introduced a bug. |
| git tag -a v1.0 -m "msg" | Create an annotated tag for a release. |
| git reflog | List where HEAD has been, useful for recovering lost commits. |
| git branch -d <branch> | Delete a branch that has been merged. |
| git remote -v | List remotes and their URLs. |
| git worktree add <path> <branch> | Check out another branch in a separate directory. |
| git config --global user.name "Name" | Set the author name used for commits. |
| git restore --staged -- path | Unstage a path while retaining its working-tree contents. Add -- before a path that could be read as an option. |
| git diff --check | Find conflict markers and whitespace errors in the current diff before committing. |
| git log --all -- path | Inspect commits touching a path across all refs, without changing files. |
| git stash show -p stash@{0} | Inspect the latest stash patch before deciding whether to apply it. |
The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.
| Section | Field | Type | Example |
|---|---|---|---|
| data | command | string | git init |
| data | description | string | Initialize a new Git repository in the current … |
The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.
curl "https://yjtoon.yunusemrevurgun.com/api/dataset/git-essential-commands?format=toon"
const res = await fetch( "https://yjtoon.yunusemrevurgun.com/static-data/dataset/git-essential-commands.toon" ); const toon = await res.text();
Rate limit: 120 requests per minute per IP, no key and no signup. API reference →
Original editorial reference notes by YJTOON, informed by the linked primary documentation. External specifications retain their own licenses.
Editorial review: . Source documents keep their own licenses.