Git for GitHub workflows

Pick 2 of 4 for GitHub workflowsOfficialAnthropic (Model Context Protocol)86,565

A GitHub workflow spans more than github.com, and the reference Git server is the second of four picks because it handles the local layer GitHub cannot reach. This Anthropic reference server works on a repo path on disk, status, diffs, commits, branches, and history, so an agent can stage and commit work directly.

It ranks second behind the hosted server, but the two are complementary rather than competing. GitHub owns the platform side; Git owns the checkout side.

How Git fits

git_status reports the working tree, git_diff_unstaged and git_diff_staged show changes around staging, and git_diff compares branches or commits, the local view of a change an agent is reviewing. git_add stages, git_commit records with a message, git_reset unstages, and git_create_branch with git_checkout isolates work. git_log, git_show, and git_branch read history and list branches. That covers committing locally before anything is pushed.

The siblings cover the other layers of a GitHub workflow. GitHub is the hosted core, reading repo files, searching code, and managing issues, pull requests, and Actions, which is why it ranks first. GitLab is the pick when a second forge is in the mix, and CircleCI handles continuous integration when CI is where the question lands. The Git server reaches none of those; it operates on the local repo only. Use it for the commit-locally step and let GitHub handle the hosted side.

Tools you would use

ToolWhat it does
git_statusShows the working tree status.
git_diff_unstagedShows changes in the working directory not yet staged.
git_diff_stagedShows changes that are staged for commit.
git_diffShows differences between branches or commits.
git_commitRecords staged changes to the repository with a message.
git_addAdds file contents to the staging area.
git_resetUnstages all staged changes.
git_logShows the commit logs with optional date filtering.
git_create_branchCreates a new branch from an optional base.
git_checkoutSwitches to the given branch.
Full Git setup and config →

FAQ

What does the Git server do that GitHub's server cannot?
It works on the local checkout. GitHub operates on the hosted platform, pull requests, issues, code search, Actions, while the Git server handles status, diffs, commits, and branches on the repo on disk, so an agent can stage and commit before pushing.
Why is Git second and GitHub first for GitHub workflows?
Because the task centers on the hosted platform, which GitHub's server owns: PRs, issues, code search, and Actions. The Git server covers the local commit layer that GitHub cannot reach. The two pair up rather than overlap.