Skip to content

Dataset

GitHub repository and pull request datasets for AI training

A GitHub dataset is a collection of the records a company keeps in its private GitHub organization: repositories with full commit history, plus the issues, pull requests, reviews, review comments, timeline events, discussions and releases written around that code. SourceX sources it to a buyer's spec from established businesses that run GitHub, so each change can be paired with the request that caused it and the review it passed. Each dataset is de-identified and licensed for an agreed permitted use.

Dataset manifest

Sourced to your spec
What it is
Private repositories with commit history, issues, pull requests, reviews, review comments, timeline events and discussions
Typical systems
GitHub Team, Enterprise Cloud or Enterprise Server organizations: repositories, Issues, pull requests, Discussions, Releases and checks
Typical history
Varies; git history usually runs from the first commit, issue and review records from the repository's arrival on GitHub or a migration into it
Modality
Source code and diffs, Markdown comment text, and structured events with actors and timestamps
Delivery formats
Agreed per order; mirror clones or git bundles, with issues, pull requests, reviews and events as JSONL keyed by number and commit SHA
Preparation
Secrets purged from history and comments; logins, commit emails, repository names and internal URLs pseudonymized
Licensing
Scoped per repository after ownership review; depends on the organization's rights in the code and on GitHub's terms
Availability
Sourced to your spec from businesses that run GitHub; supply is not guaranteed
CodeIllustrative

What a delivery contains

Fields vary by source system and are fixed per order. A typical delivery includes:

FieldTypeWhat it holds
repository_refobjectThe Repository: pseudonymous name, default branch, visibility, and its fork and archived flags.
numberintegerThe number an Issue or Pull request holds in the repository's single sequence, which both record types share.
descriptionobjectTitle, Markdown body, labels, milestone and state of the Issue or Pull request, with state_reason on an Issue.
head_and_baseobjectThe Pull request's head and base: branch names, commit SHAs and whether the head sits in a fork.
pr_commitsarrayCommits listed on the Pull request, in order, each with SHA, parents, author date and message.
reviewsarrayReview records: state (approved, changes requested, commented or dismissed), the commit reviewed and the submission time.
review_commentsarrayReview comments with path, diff_hunk, line, original_line, commit_id, original_commit_id and in_reply_to_id.
thread_resolutionobjectPer review thread, the GraphQL isResolved and isOutdated flags and who resolved it.
conversation_commentsarrayIssue comments from the conversation tab of an Issue or Pull request, with author_association and timestamps.
timeline_eventsarrayTimeline events such as committed, reviewed, head_ref_force_pushed, renamed, cross-referenced, closed and merged.
merge_resultobjectThe Pull request's merged flag, merged_at, merged_by and merge_commit_sha, with the merge method where it can be established.
closing_referencesarrayIssues the Pull request was set to close, with cross-referenced events that link it to other numbers.
check_runsarrayCheck runs reported on the head commit: name, app, status, conclusion and output summary.
discussionobjectA Discussion from the repository: category, body, threaded comments and the comment chosen as the answer.
Sample recordIllustrative

Field names from the table above; values are masked placeholders.

Example record

{
  "repository_ref": {"name": "repo_7c2e", "default_branch": "main", "visibility": "private"},
  "number": 1418,
  "description": {
    "type": "pull_request",
    "title": "Retry invoice sync when the ledger API returns 429",
    "labels": ["billing", "bug"],
    "state": "closed"
  },
  "head_and_base": {
    "head_ref": "fix/invoice-sync-backoff",
    "head_sha": "9b41f0c",
    "base_ref": "main",
    "base_sha": "e27a6d3"
  },
  "pr_commits": [
    {"sha": "51c0aa7", "message": "Add backoff to invoice sync"},
    {"sha": "9b41f0c", "message": "Cap retries and log the final failure"}
  ],
  "reviews": [
    {
      "by": "user_044",
      "state": "CHANGES_REQUESTED",
      "commit_id": "51c0aa7",
      "submitted_at": "2024-03-11T13:02:10Z"
    },
    {
      "by": "user_044",
      "state": "APPROVED",
      "commit_id": "9b41f0c",
      "submitted_at": "2024-03-12T16:05:33Z"
    }
  ],
  "review_comments": [
    {
      "id": "rc_88213",
      "path": "services/billing/sync.py",
      "diff_hunk": "@@ -41,6 +41,12 @@ def sync_invoice(invoice):",
      "original_line": 47,
      "original_commit_id": "51c0aa7",
      "commit_id": "9b41f0c",
      "author_association": "MEMBER",
      "body": "This retries forever if the ledger stays down. Cap it and surface the last error."
    }
  ],
  "thread_resolution": {
    "rc_88213": {"is_resolved": true, "is_outdated": true, "resolved_by": "user_019"}
  },
  "conversation_comments": [
    {"by": "user_019", "body": "Capped at five attempts, see the second commit."}
  ],
  "timeline_events": [
    {"event": "reviewed", "at": "2024-03-11T13:02:10Z"},
    {"event": "committed", "sha": "9b41f0c", "at": "2024-03-12T15:40:51Z"},
    {"event": "merged", "at": "2024-03-12T16:11:07Z"}
  ],
  "merge_result": {
    "merged": true,
    "merged_by": "user_019",
    "merge_commit_sha": "c4d8e19",
    "method": "squash"
  },
  "closing_references": [1397],
  "check_runs": [
    {
      "name": "unit-tests",
      "head_sha": "9b41f0c",
      "status": "completed",
      "conclusion": "success"
    }
  ],
  "discussion": null
}

Synthetic record for illustration. Field names, structure and format are agreed per order.

What AI teams use it for

Train review models on anchored comments

A review comment with its diff_hunk and original commit, followed by the push that answered it, is one complete round of review.

Build issue-to-patch tasks

Closing references tie an issue's text to the pull request that fixed it, with the base commit as the starting state.

Learn how review rounds end

Timeline events order each request for changes, each push and the final approval, so models see what it took to pass.

Evaluate coding agents on unseen repositories

Merged pull requests from repositories that were never public give test tasks a model is unlikely to have met in pretraining.

Model issue triage

Labels, assignments, state_reason values and transfers show how a team sorted, declined and deduplicated incoming reports.

Use-case guides: Coding agents, Private evaluation sets, Enterprise and computer-use agents

What makes this data valuable

Commits before the squash

Pull request commits are delivered from the pull request itself, as well as the single commit on the base branch.

Anchors that resolve

Every original_commit_id on a review comment points at a commit present in the delivered git data.

Thread state included

Resolved and outdated flags from the GraphQL API come with the review comments.

Full timeline

Events found only on the timeline, such as committed and reviewed, are present beside labels and renames.

Unmerged work kept

Pull requests closed without merging are included and marked, with their reviews.

Automation labeled

Comments and pull requests from apps and bots are flagged, so they can be kept or filtered.

Record timeline

GitHub dataset

This page covers gitHub repositories and pull request histories.Illustrative

One number sequence, and comments pinned to commits

GitHub treats every pull request as an issue. The two share one number sequence per repository, and the issues API returns both, marking a pull request with a pull_request key. A bare number in a commit message or comment therefore resolves to one record, and cross-referenced events and closing references connect a request to the change that answered it. Review splits into three record types: the review, which holds the verdict and the commit it was given on, the review comment, which is anchored to code, and the issue comment on the conversation tab, which is not.

Each review comment stores a path, the diff_hunk it was written against, line and original_line, and both commit_id and original_commit_id. When a later push changes that line, GitHub marks the thread outdated, and the original fields keep the position as the reviewer saw it. The useful unit is the comment, its hunk and the next commit on the pull request that touched the same path. Whether the thread was resolved is a field of the GraphQL review thread, not of the REST comment.

History on the pull request branch is less stable than the events about it. A force push writes a head_ref_force_pushed event, and the GraphQL form of that event names the commit before and after, but the earlier commits leave the branch and a clone of branches will not fetch them. A squash merge puts one commit on the base branch, recorded as merge_commit_sha, and a rebase merge creates new SHAs. After either, the commits a reviewer read are reachable through the pull request's own head ref in the read-only refs/pull namespace, not through the default branch. An ordinary clone does not fetch that namespace, so it has to be asked for. After a force push that ref follows the new head, and whether the replaced commits can still be fetched is something to test.

A clone carries the code, and the API carries the rest

A git clone returns commits, branches and tags. Issues, pull requests, reviews, discussions and releases are not git objects. They come out through the REST API, the GraphQL API or a migration archive, and the three routes do not return the same things. REST review comments carry the anchors but no resolution state. Discussions, with their categories, threaded replies and chosen answers, are documented through GraphQL. Some events, including committed, reviewed and cross-referenced, appear only in the timeline API and not in the older issue events list.

An organization owner can also generate a migration archive through the API, with options to leave out metadata, git data, attachments or releases. The API reference does not itemize the archive, so ask for its file list. GitHub's documentation for a separate tool, which moves repositories between GitHub products, shows the losses to look for. It lists git source, pull requests, issues, milestones, wikis, commit comments, releases and attachments as migrated, and repository-level discussions, the edit history of issue and pull request comments, commit status checks, sub-issues and Git LFS objects as not migrated. Check runs and commit statuses raise their own question: GitHub's retention documentation describes applying the organization's retention period to them as well as to logs and artifacts, so ask whether pass and fail marks on old commits still exist.

To test a sample, take a squash-merged pull request and confirm its original commits were delivered. Resolve a review comment's original_commit_id against the git data. Find a head_ref_force_pushed event and see whether the commits before it exist. Look for gaps in the number sequence and ask what each one was.

What to check before licensing

  • Confirm the organization owns the code in every repository in scope. Contractor work, client deliverables, forks and vendored open-source code are common exceptions.
  • Ask how secrets committed in history were found and removed. Rewriting history changes commit SHAs, so ask for the mapping that keeps review comment anchors valid.
  • Read GitHub's terms on API use, bulk export and exported data for the supplier's plan. Buyer and data owner both check.
  • Ask which route produced the non-git records: REST, GraphQL or a migration archive, and whether thread resolution, discussions and timeline events were pulled.
  • Check that commits from before squash merges and force pushes were fetched from the pull requests, and are not limited to what branches reach.
  • Confirm logins are pseudonymized the same way in commit metadata, comment authors, mentions inside comment text and CODEOWNERS files.
  • Ask how files attached to issues and comments were treated, since comment bodies only link to them, and scan comment text for pasted tokens and internal URLs.

Delivery No files move before a signed license. A listing or a request grants no files by itself.

How licensing works through SourceX

  1. 1

    Define

    Send the domain, modality, volume, format, timeline and permitted use you need.

  2. 2

    Source

    SourceX identifies businesses that hold matching data and are open to licensing it.

  3. 3

    Qualify

    Fit, rights and quality are checked, and you review samples before committing.

  4. 4

    License

    Scope, permitted use, exclusivity, price and obligations are agreed in writing.

  5. 5

    Deliver

    Approved data is prepared, de-identified where required and transferred securely.

Questions Acquisition Partners ask

Does a clone of a GitHub repository include its issues and pull requests?

No. A clone holds commits, branches and tags only. Issues, pull requests, reviews, review comments, discussions and releases are stored by GitHub outside git and have to be exported through the REST or GraphQL API or a migration archive. Ask which route was used, because each returns a different subset.

Can a GitHub review comment be matched to the code it was written about?

Yes, when the anchor fields are delivered. Each review comment stores the file path, the diff hunk, the original line and the original commit it was made on. Matching fails when that commit is missing from the git data, which happens after force pushes and squash merges if only branches were cloned. Ask for commits fetched from the pull requests themselves.

What does a squash merge do to pull request history?

It replaces the pull request's commits with one commit on the base branch. GitHub records that commit as merge_commit_sha, and the intermediate commits are not kept on the base branch. They stay attached to the pull request, where the timeline lists each one. For review data this matters, because reviewers commented on the intermediate commits, not on the squashed result.

Are GitHub Discussions part of the dataset?

Only when they are pulled separately. Discussions are their own record type with categories, threaded comments and an optional chosen answer, and GitHub documents them through the GraphQL API. GitHub's documentation for moving repositories between its products lists repository-level discussions among the items not migrated. If design debates held in Discussions matter to you, name them in the spec.

How is this different from public GitHub data?

It comes from private repositories, which public code corpora do not hold. Public GitHub repositories are widely copied into pretraining corpora, so a model may already have seen their fixes and reviews. A private organization's code, issues and review threads were written for colleagues behind access control. Confirm that each repository was never public and is not a fork of public code. SourceX does not source scraped public web content, and each dataset comes from the business that owns the repositories, under a signed agreement.

Is SourceX affiliated with GitHub or Microsoft?

GitHub is named to identify the system the records come from. That does not imply a partnership with or endorsement by GitHub or Microsoft. The records belong to the business that runs GitHub, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.

Evaluating this data for procurement?

Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.

Request dataset diligence

Tell us what your models need

Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.

Updated 26 November 2026. Own data like this? See how companies license it to AI developers.

See if your company qualifies