Git2KG: Mining socio-technical relationships in GitHub repositories as temporal knowledge graphs

Lennart Hessenauer, Lisi Qarkaxhija, Ingo ScholtesarXiv 2026 · arXiv

TL;DR

Git2KG is an extensible Python library that bridges the gap between code-level history and social interaction by mining GitHub repositories into Temporal Knowledge Graphs (TKGs). By aligning Git commit logs with GitHub issue tracker data, it allows researchers to analyze how developer communication and fine-grained code contributions evolve together over time.

What Problem Does This Paper Address?

Open Source Software (OSS) development is a "socio-technical" process: it involves both technical artifacts (code, files, commits) and social interactions (issue discussions, code reviews, mentions). Traditionally, researchers have studied these in silos. You might have a "people network" based on who comments on whose issues, or a "co-authorship network" based on who edits the same files.

However, these fragmented views miss the bigger picture. Furthermore, most existing tools provide a static, time-aggregated view of a project, which ignores the temporal dynamics—how a team’s behavior shifts during a release cycle or a security crisis. The authors identify a need for a unified tool that handles identity disambiguation (linking a Git email to a GitHub username) and supports temporal analysis out of the box.

Methods

Git2KG builds a multi-relational graph with four primary node types: Actors, Commits, Files, and Issues.

Fig. 1. Schema of Git2KG knowledge graphs. The color encodes the data source. The actor entity appears in both sources as the aligning entity.

Key technical components include:

  • Unified Schema: It extracts 20 different relation types (e.g., edit_add, mentions, assigned_to). Notably, it uses line-level co-editing relations rather than just file-level authorship, providing a higher-resolution view of collaboration.
  • Identity Alignment: To connect the subgraphs, Git2KG uses a tool called gambit for string-similarity matching of names and emails, supplemented by GitHub’s commit API to link private emails to public accounts.
  • Time Slicing: The library slices development events into configurable, non-overlapping time windows (snapshots). This transforms a static graph into a TKG.
  • Extensible Pipeline: It includes engines for computing node features and labels, making it a "one-stop-shop" for preparing data for Graph Neural Networks (GNNs). It exports directly to popular frameworks like PyTorch Geometric, PathPyG, and NetworkX.

Datasets

The authors demonstrated Git2KG using the xz-utils repository, a high-profile project that gained notoriety in early 2024 due to a malicious backdoor discovery. The dataset used for demonstration included:

  • 3,142 commits
  • 447,650 line edits
  • 252 issues with 1,131 comments
  • 244 code reviews

Key Insights and Ideas

  • The Actor as the Bridge: The "Actor" entity is the only one present in both Git and GitHub data. Successful alignment is the "secret sauce" that turns two disconnected graphs into a single socio-technical knowledge graph.
  • Visualizing Crisis: By comparing snapshots, the authors show how a project's "shape" changes. In a normal month (Feb 2024), the graph is dominated by code-related edges. In the month the backdoor was discovered (March 2024), the graph explodes with social communication edges.
  • Fine-Grained Collaboration: By tracking line-level edits (edit_add/edit_delete), the tool captures actual collaboration between developers working on the same parts of a file, which is much more precise than simply noting they both touched the same large file.
Fig. 3. Visualization of two consecutive monthly snapshots of the TKG mined from the repository of xz-utils. Color and shape of the nodes indicate the entity type. The color of the edge refers to the entity type of its end node. The shape of the edge’s line indicates the entity type of its start node. The security breach was discovered in March 2024.

Key Results

  • Mining Performance: The library utilizes multiprocessing to handle the computationally expensive task of parsing Git logs. Using 16 cores resulted in a 3.6x speedup for overall data loading, with the "edits" extraction stage seeing a 4.38x speedup.
  • Alignment Validation: The evaluation showed that in most snapshots, actors active in the Git log were successfully aligned with active GitHub accounts, confirming that the socio-technical subgraphs are well-connected.
Fig. 2. Loading time of the Git-based extraction stages with different numbers of cores in seconds. The line represents the median loading times across five runs. The band represents the minimum and maximum loading time of five runs. The runs were conducted on an AMD Ryzen AI 9 HX 370.

Limitations and Future Work

While Git2KG is a powerful mining tool, the authors note several limitations:

  • Lack of Semantics: The tool tracks that code was changed, but not what the code does (program semantics) or its structural quality.
  • Missing Data Sources: It currently does not incorporate Continuous Integration (CI) outcomes, repository forks, or line-level review comments.
  • API Volatility: Because it relies on the GitHub GraphQL and REST APIs, it is subject to changes in GitHub's external interface.

Future work aims to use Git2KG for large-scale ecosystem analyses and predictive tasks, such as forecasting developer turnover or identifying high-risk code changes.

Summary updated

Abstract

The widespread use of Git and GitHub in open source software (OSS) projects has produced large volumes of data on collaborative software development. Existing approaches to mine those data often use graph models to (i) capture communication between developers in the issue tracker, or (ii) represent developer-developer co-authorship or developer-file code ownership networks from the editing history of code artifacts. Integrating these data in a single knowledge graph (KG) is complicated by the need to disambiguate authors and match entities from multiple sources. Moreover, most works using network analysis have taken a time-aggregated perspective that neglects temporal dynamics of collaborations. To address these issues, we present Git2KG, an extensible Python library that mines temporal knowledge graphs (TKGs) from GitHub repositories. Git2KG extracts fine-grained co-editing relations and code ownership from the Git log. It further disambiguates developer identities to align the resulting graphs with management and communication networks extracted from GitHub issue trackers. Git2KG supports temporal analysis by slicing development events into fixed-size, non-overlapping time windows, yielding a series of knowledge graph snapshots per repository. It further supports computing node features and labels for downstream machine learning tasks. Snapshots can then be exported to PyTorch Geometric, PathPyG, and NetworkX for temporal network analysis, visualization, and graph learning.
BibTeX
@misc{hessenauer2026git,
  author = {Lennart Hessenauer and Lisi Qarkaxhija and Ingo Scholtes},
  title = {{Git2KG: Mining socio-technical relationships in GitHub repositories as temporal knowledge graphs}},
  year = {2026},
  eprint = {2611.15509},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.15509},
}
Figure