You can see what code a Jenkins build actually ran by starting with the build's SCM metadata: open the build, follow the "Git Build Data" (or equivalent changelog) link, and read the revision list plus the "Changes" tab. If the job archives its checkout or prints git show, you get the diff too; otherwise Jenkins shows commit IDs and messages, not file-level content. The key condition is that the changelog is populated only when the job's SCM configuration is correct and the build triggers a checkout/polling step—jobs with no SCM, or with changelog calculation disabled, will show nothing useful.

That distinction—metadata versus actual diff—drives everything below. Jenkins was never a code-review tool. It knows about changes because the SCM plugin asks the repository for the revisions since the last successful build, then records them as build data. Whether you can see line-by-line changes depends on whether the pipeline stores them or prints them. This guide covers the surfaces Jenkins exposes for Git and similar SCMs, the configuration behind them, pipeline approaches that produce a real diff, troubleshooting when the changelog is empty, and the limits you should expect. Version-specific details referenced here reflect common current Jenkins behavior; menu labels have shifted slightly across core and plugin releases, and your installed plugin set governs some of the entries.

Where Jenkins exposes change information

There are four practical surfaces, and they answer different questions.

The Changes page for a build. Every freestyle or pipeline build has a "Changes" entry in its left-hand menu when the SCM plugin detected revisions. It lists commits—usually abbreviated hash, author, date, and commit message—grouped by repository. This is metadata, not a patch. It tells you what was committed, not which lines moved.

The "Git Build Data" (or repository) side panel. On builds using the Git plugin, an additional link such as "Git Build Data" opens a page with the build's revisions per remote/branch, the branches built, and the changelog. This is often richer than the generic Changes page because it shows commit IDs as the SCM plugin recorded them, and it exposes which branch was checked out.

Pipeline run output and stage logs. The console log shows the checkout command and, for pipelines that inspect the repository themselves, whatever diff output the pipeline prints. This is the most reliable place to find actual line-level changes because the pipeline author controls it.

Archived artifacts and workspace snapshots. If a job archives a diff.patch or tarball of the workspace, you can download it from the build page. This is the only surface that preserves content when the workspace itself is wiped by a later build.

A quick mental model: the Changes page tells you which commits; the console log and artifacts tell you what the code changed to. For most debugging ("did my fix get into build 412?"), the commit list plus hash comparison is enough. For code review or post-mortem analysis ("what exactly changed between 411 and 412?"), you need the diff surfaces.

A concrete example helps. Suppose a freestyle job builds main every time the repository changes. Build #412 shows two commits on the Changes page: one adding a null check, one bumping a dependency. The Git Build Data page shows main at commit 3f2a1c9. The console log's checkout line shows the same hash. That is the full extent of the accidental evidence Jenkins produces—enough to answer "which commits," not "which lines." If you need line-level detail, the pipeline must produce it.

Prerequisites before the Change page populates

Empty changelogs are usually configuration problems, not Jenkins bugs. Work through these before touching pipeline code.

1: The job has an SCM source. Under "Source Code Management," a Git (or SVN, Mercurial) repository must be configured with a valid URL. Jobs that copy files or run only shell steps won't have SCM metadata. 2: Credentials and network access work. The checkout must succeed. If the build fails at checkout, no changelog is recorded for that build. 3: Changelog computation is on. In the Git plugin's job configuration, leave "Compute changelog" enabled (the default). Some teams disable it to speed up large repos; that removes the Changes page entirely. 4: Pipelines must call checkout scm (or an equivalent). In declarative pipelines, the implicit checkout scm in the agent block usually handles this. If your pipeline drives Git with raw sh 'git clone …' commands instead of the checkout step, Jenkins doesn't see the revision and won't populate build data. 5: The first build of a job has no previous revision. It shows the initial checkout but no "changes since last build" because there's no baseline. The second build onward is where the changelog appears.

A simple success check after the first two builds: open a build and confirm the Changes link exists and lists the commits you know were pushed. If it doesn't, open the Git Build Data page and confirm a revision hash is recorded. If neither appears, the problem is in steps 1–4, not in how you're reading the UI.

Reading the Git Build Data and Changes pages

Once populated, these pages are compact. Here's how to get the most out of them.

Commit hash. The full or abbreviated SHA identifies exactly what was built. Copy it for cross-reference against your local git log. Branch. The Git Build Data page records which branches the build checked out, which matters when a job builds tags or multiple branches. Author and committer. Useful for finding who to ask; Jenkins reads this from the commit, so it inherits any misattribution in the repository history. Commit message. The most human-readable signal. If your team writes meaningful messages, the Changes page alone often answers "what changed." Build comparison. Some Jenkins UIs let you compare two builds (the "Changes since last successful build" link on the job page). This aggregates commits across the interval, which is handy when several builds failed in a row.

A practical workflow: find the last green build number, note its commit hash from Git Build Data, then compare with the failing build's hash. The commits in between are your suspect set. You can then run git log .. locally or in a pipeline step to expand the detail.

One subtlety: "changes since last build" and "changes since last successful build" differ. A failed build still records its changes; the job page link may target the last successful one. When triaging a failure, check both links so you don't omit commits from interim failed builds.

Getting an actual diff in a pipeline

If you need line-level changes—old versus new file contents—Jenkins won't produce that from metadata. You have to ask Git to produce it inside the pipeline and print or archive the result.

A workable approach uses the previous build's revision, which the Git plugin exposes through environment variables. After a checkout scm, the variables include the current commit (GIT_COMMIT) and, when a previous build exists, the previous revision (GIT_PREVIOUS_SUCCESSFUL_COMMIT or GIT_PREVIOUS_COMMIT). You can then run a diff between them:

In a script block, read env.GIT_COMMIT and env.GIT_PREVIOUS_COMMIT. If both are non-empty and different, run git diff --stat .. first. The stat view lists changed files and line counts without flooding the log. For a full patch, run git diff .. and either print it (for small changes) or write it to a file and archiveArtifacts it. If GIT_PREVIOUS_COMMIT is empty (first build or a wiped history), skip gracefully and note the reason in the log.

This gives you a real, reviewable artifact: a changes.patch attached to each build. The pipeline author controls the scope—maybe --stat for routine builds, full patches only for release branches. Note that GIT_PREVIOUS_SUCCESSFUL_COMMIT may be empty for the first successful build, and in some multibranch or matrix setups the variable reflects the repository-level previous build rather than your specific branch. Check the values in the console log before relying on them; adding a debug print of both variables during rollout is worth the noise.

An important limit: git diff between two commit hashes requires both commits to be present in the local clone. Shallow clones, which some pipelines use for speed, may lack the older commit, and the diff will fail or show incomplete output. Deepen the fetch for the comparison, or fetch the specific base commit explicitly.

Alternatives when pipelines shouldn't produce diffs

Not every job should carry diff logic. Three alternatives cover the common cases.

Use the SCM's own comparison view. GitHub, GitLab, Bitbucket, and similar hosts compare two commits or two branches natively. Copy the two hashes from Jenkins into the host's compare URL and read the diff there, with syntax highlighting and comment support. This is often faster than rebuilding diff logic in the pipeline and avoids storing patches on the Jenkins controller.

Build a lightweight notification step. Instead of printing patches, have the pipeline post the commit range to chat or email: "Build 412: 3 commits from abc123 to def456." Teammates click through to the host. This keeps Jenkins logs small while preserving the pointer to the full diff.

Use the Multibranch and pull-request plugins deliberately. For pull-request builds, the PR's own diff is on the host; Jenkins is just the executor. Configure the job name and build description to include the PR number and source commit so the build page is a gateway to the review, not a replacement for it.

Choose based on audience. Developers fixing a failed build need line-level diffs quickly; stakeholders watching a dashboard need commit summaries. A single pipeline can do both: print a --stat summary in the log and archive the full patch for anyone who wants it.

When the change list is empty or wrong: symptoms and fixes

Troubleshoot by symptom, and start with reversible checks.

The Changes link is missing entirely. Likely causes: no SCM configured, changelog computation disabled, or a pipeline that bypasses the checkout step. Check the job configuration first (reversible), then the pipeline source for a raw git clone.

The link exists but the list is empty on a build that should have changes. Likely causes: the build pulled the same revision as the previous build (nothing changed), the polling trigger didn't detect new commits, or the branch configured in the job differs from the one pushed to. Verify the recorded hash on Git Build Data matches the hash you expect. If it does, there genuinely were no new commits from that branch.

The listed commits belong to someone else's branch. In multibranch pipelines, confirm you're on the right branch's build. The build's branch is shown on the Git Build Data page; a merge into main can bring in commits authored on a feature branch, which is correct behavior, not a misconfiguration.

The diff step fails with "bad object" or "unknown revision." The local clone is shallow or the previous commit wasn't fetched. Fetch the base commit explicitly or increase clone depth. This is a pipeline fix, not a Jenkins core issue.

The change list appears on the job page but not inside the build. Some themes or custom views hide menu entries. Test with the default theme before investigating further; UI customizations are a common cause of "missing" links.

If the changelog is wrong—for example, it lists commits that were never built—the most likely explanation is that the job is configured against a different branch or remote than you expect, or that a force-push rewrote history and the SCM plugin recorded the old hashes. Compare the build's recorded hash with git log on the server; mismatch here is a configuration problem, not a display problem.

Stop and involve platform or DevOps if fix attempts require changing shared plugin versions or controller-level security settings, especially when multiple jobs depend on the same SCM configuration. Those changes can silently affect other teams' builds.

Limits, versions, and what Jenkins will never show

It's worth being clear about the boundary. Jenkins records revisions and commit messages because the SCM plugin requests them at checkout time; it does not store file contents unless you archive them or print them. Cloning the repository yourself and running git diff between the recorded hashes is the canonical way to see actual changes, and it works entirely outside Jenkins.

Version differences matter. The Git plugin's build data page has been labeled "Git Build Data" in recent releases, while older configurations may show a plain "Git" or repository-named entry. The specific "Changes" menu entry is provided by core build data, not the Git plugin, so it can appear even for jobs where the richer Git page is absent. If labels in your instance differ from this description, check the plugin manager for the installed Git plugin version and consult that plugin's documentation for the exact page names—this is stable, well-documented behavior, but labels are plugin-authored and have changed over time.

Two limitations are structural and won't go away. First, Jenkins cannot show a diff for a build whose SCM metadata was never recorded, so historical empty builds can't be retroactively filled in. Second, a commit message is only as informative as the commit—if history is squashed or messages are terse, the Changes page will be terse too. Neither problem is solved by Jenkins configuration alone; they're fixed upstream in your team's commit practices.

A final note on scope: the above holds for Git and closely analogous SCMs. Subversion and Mercurial jobs expose revision numbers rather than hashes, and pipeline diffing uses different tools (svn diff, hg diff). The surfaces are the same—build data page, console log, archived artifacts—but the exact commands and variables differ. Consult the specific SCM plugin's page in the plugin manager for its variable names before writing pipeline logic.