Complete Git & GitHub CLI command reference — searchable, fast, always free
🔍
Click or hover any command for a longer description & example
| git config --global user.name | Set global username |
| git config --global user.email | Set global email |
| git config --list | Show all config values |
| git init | Initialize new repository |
| git clone <url> | Clone a remote repository |
| git status | Show working tree status |
| git add <file> | Stage a specific file |
| git add . | Stage all changes in current directory |
| git add -p | Interactively stage chunks |
| git commit -m "msg" | Commit with message |
| git commit -am "msg" | Commit all tracked changes |
| git commit --amend | Amend the last commit |
| git push | Push current branch to its upstream |
| git pull | Fetch and integrate changes (merge or rebase) |
| git fetch | Fetch without merging |
| git branch | List all branches |
| git branch <name> | Create new branch |
| git switch <branch> | Switch to branch |
| git checkout -b <name> | Create & switch to new branch |
| git merge <branch> | Merge branch into current |
| git rebase <branch> | Rebase onto branch |
| git cherry-pick <commit> | Apply a specific commit |
| git branch -d <name> | Delete local branch |
| git push origin --delete <name> | Delete remote branch |
| git diff | Show unstaged changes |
| git diff --staged | Show staged changes |
| git log --oneline | Compact commit history |
| git log --oneline --graph --decorate --all | Visual branch graph (all branches) |
| git show <commit> | Show commit details & diff |
| git blame <file> | Show who changed each line |
| git reflog | Show full HEAD history |
| git restore <file> | Discard working dir changes |
| git reset HEAD <file> | Unstage a file |
| git reset --soft HEAD~1 | Undo commit, keep staged |
| git reset --hard HEAD~1 | Undo commit & discard changes |
| git revert <commit> | Create a revert commit |
| git stash | Stash current changes |
| git stash list | List all stashes |
| git stash pop | Apply & remove latest stash |
| git stash drop | Discard a stash (latest by default) |
| git stash apply stash@{n} | Apply a specific stash |
| git remote -v | List remotes with URLs |
| git remote add origin <url> | Add remote origin |
| git push -u origin <branch> | Push & set upstream |
| git tag | List all tags |
| git tag v1.0 | Create lightweight tag |
| git push origin --tags | Push all tags to remote |
| gh auth login | Authenticate with GitHub |
| gh auth status | Show authentication status |
| gh repo create | Create a new repository |
| gh repo clone <user/repo> | Clone a repository |
| gh repo view | View repo info in terminal |
| gh pr create | Open a new pull request |
| gh pr list | List open pull requests |
| gh pr view | View current branch PR |
| gh pr merge | Merge a pull request |
| gh pr checkout <number> | Check out a PR locally |
| gh pr review --approve | Approve a pull request |
| gh issue create | Create a new issue |
| gh issue list | List open issues |
| gh issue view <number> | View issue details |
| gh issue close <number> | Close an issue |
| gh run list | List recent workflow runs |
| gh run view <id> | View a workflow run |
| gh run watch | Watch a run in real-time |
| gh release create | Create a new release |
| gh release list | List all releases |