The core distinction: git is the version-control engine that talks to any remote, while gh wraps GitHub-specific operations (PRs, issues, releases, Actions) and some convenience clones on top of git. A — below means there's no meaningful equivalent for that tool.
| Task |
git |
gh |
| Authenticate |
Configure SSH keys or a credential helper (git config credential.helper) |
gh auth login |
| Check auth status |
— |
gh auth status |
| Set a config value |
git config --global user.name "Name" |
gh config set editor vim |
| Clone a repo |
git clone <url> |
gh repo clone owner/repo |
| Create a new repo |
git init (local only) |
gh repo create |
| Add a remote |
git remote add origin <url> |
— (set automatically on clone/create) |
| Task |
git |
gh |
| Check working-tree status |
git status |
— |
| Stage changes |
git add <file> |
— |
| Commit |
git commit -m "msg" |
— |
| Push / pull |
git push / git pull |
— |
| Create a branch |
git switch -c <branch> |
— |
| Fork a repo |
— |
gh repo fork |
| Open a pull request |
— |
gh pr create |
| List pull requests |
— |
gh pr list |
| Check out a PR locally |
git fetch origin pull/<n>/head + branch |
gh pr checkout <number> |
| View a PR |
— |
gh pr view <number> |
| Open repo in browser |
— |
gh browse / gh repo view --web |
| Task |
git |
gh |
| Review / approve a PR |
— |
gh pr review |
| Merge a PR |
git merge (local branches) |
gh pr merge <number> |
| Manage issues |
— |
gh issue create / gh issue list |
| Create a release |
git tag <tag> + git push --tags |
gh release create <tag> |
| Manage gists |
— |
gh gist create <file> |
| Run / view Actions |
— |
gh workflow run / gh run list |
| Call the GitHub API |
— |
gh api <endpoint> |
| Define aliases |
git config alias.co checkout |
gh alias set co pr checkout |
| Cherry-pick |
git cherry-pick <sha> |
— |
| Rebase (incl. interactive) |
git rebase [-i] <ref> |
— |
A useful mental model: anything about history and local state stays in git; anything that touches GitHub-the-service is where gh earns its place. The two overlap only on a handful of convenience wrappers (clone, merge, browse).