Open-source project
GumTreeDiff/gumtree avatar
GumTreeDiff/gumtree

GumTree for syntax-aware source code diffing

An awesome code differencing tool

1,342 stars189 forksJavaLGPL-3.0

At a glance

What is it?
GumTree is a Java-based, syntax-aware differencing tool for developers and researchers who need source changes aligned with code structure, including moved or renamed elements. The repository is current, but its public README delegates installation and detailed usage to the project wiki.
Who is it for?
GumTree is appropriate for developers, tool authors, and researchers who need structural source code diffs or Git integration, especially when moved elements make text output misleading. It is less suitable for users who need a self-contained installation guide, documented upgrade procedure, or language coverage beyond the documented set.
Can I use it commercially?
Yes, with conditions. LGPL-3.0 is a weak copyleft licence: you can use it inside commercial and closed-source software, but if you distribute changes to its own files, you must publish those changes under the same licence.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 21, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why GumTree compares syntax instead of raw lines

GumTree addresses a specific weakness of line-oriented comparison: source changes do not always correspond neatly to inserted or deleted lines. Its edit actions are aligned with syntax, so the diff is intended to describe changes in program structure rather than merely report where text moved. The project also detects moved or renamed elements, a distinction that matters when code is relocated or a declaration changes identity without being treated as an unrelated deletion and insertion.

The intended users include developers examining source changes, maintainers of code analysis systems, and researchers working on fine-grained program differencing. The repository is primarily Java, and its research citations cover syntax-aware and fine-grained source differencing. This makes GumTree more directly relevant to code intelligence, refactoring analysis, and source change tooling than to users who only want to compare arbitrary text files.

The boundary is equally important. The README documents C, Java, JavaScript, Python, R, and Ruby as supported languages. It does not claim support for every parser or every file type, and the wiki language page is the authoritative place to check details. A language appearing in a repository directory or generation package is not, by itself, sufficient evidence that the public workflow is equally complete for that language.

GumTree's structural diff model and repository shape

The README describes GumTree as syntax-aware, and the repository layout supports a language-oriented architecture. Directories such as `gen.antlr3`, `gen.antlr4`, `gen.jdt`, `gen.javaparser`, `gen.js`, `gen.json`, `gen.srcml`, `gen.treesitter-ng`, `gen.xml`, and `gen.yaml` indicate that language-specific front ends are part of the project. The Java-oriented modules include `core`, `client`, and `client.diff`, while `dist` appears to hold distribution-related files. These names support a broad picture, but the README does not document the internal class flow or configuration of each module.

At the functional level, the documented data flow begins with source code for a supported language. GumTree interprets that code according to its syntax and expresses differences as edit actions aligned with program elements. A normal textual diff can classify a relocation as deletion in one place and insertion in another. GumTree can instead detect that an element moved, and it can represent a rename as a distinct relationship. Consumers can therefore use edit data that carries more structural meaning.

The repository also includes Git integration through the linked `VCS-Integration` documentation. The README does not specify the exact Git integration commands, hooks, transport protocol, or output format. For that reason, the existence of integration should not be interpreted as a claim that any particular version-control workflow is configured automatically. The wiki must define how a repository is connected and how GumTree results are consumed.

Installing GumTree and reaching a first comparison

The public README does not provide installation commands, a package-manager invocation, Java version, Gradle command, container invocation, or download procedure. It directs users to the `Getting Started` page in the GumTree wiki. Because that page is not reproduced in the README, a command here could risk inventing a flag or dependency setup that is not documented.

A first real use therefore begins in the wiki rather than in the README. Consult `Getting Started` for the installation sequence, then use `Languages` to confirm that the intended language is supported. The README also links to `VCS-Integration`, which is the relevant next reference when the intended workflow compares changes from Git rather than files supplied directly to GumTree.

After installation, the initial validation should compare two small source files containing a clear structural change. A move is a better first check than a plain line insertion because it exercises GumTree's distinguishing behavior. If Git integration is the goal, follow the wiki's integration procedure and verify that the resulting edits identify the expected structural change. The screenshots shown in the README cover directory and file viewers, including CSS and Java examples, but they do not document operating-system prerequisites or launch commands.

What GumTree replaces in a text-diff workflow

The direct alternative is a conventional text differencing tool that compares files line by line. That approach is simpler in presentation and can be appropriate when whitespace, formatting, or raw text changes are the primary concern. Its representation of a relocation is often split between a deletion and an insertion because the character sequences occupy different locations.

GumTree takes a different route. It aligns edit actions with syntax and can identify movement or renaming. A consumer interested only in whether two files differ may gain little from that distinction, while a refactoring analysis, code review aid, or research pipeline can use it to reason about what changed in the program rather than where lines moved.

This does not make GumTree a direct replacement for every patch workflow. The README does not state that its output preserves a standard unified patch, nor does it claim that syntax-aware results alone answer every review need. Text-based tools remain relevant when byte-level or line-level fidelity matters. The decision depends on whether the consumer needs structural edit semantics or a conventional textual representation, and documentation for that output format is still necessary before integration.

GumTree language and output limitations

Language coverage is the clearest adoption constraint. The README names C, Java, JavaScript, Python, R, and Ruby, while linking to the `Languages` wiki page for details. It also says that more languages are coming, but a stated intention does not establish production support. Users working with another language should treat the wiki's current list and configuration guidance as the decision point.

GumTree is also the wrong tool when the source cannot be parsed in a meaningful syntax-aware form, or when the comparison is primarily about generated data rather than program structure. A JSON file can be compared as text without treating its syntax as a programming language, although the repository contains a `gen.json` component. The README does not explain which JSON semantics are available or whether parser failures are ignored, so that behavior should not be assumed.

Parser handling is another documented gap. The project lists both Java parser technologies and ANTLR-related generator directories, but the README does not describe unsupported syntax, error recovery, grammar versioning, or partial parse results. Generated parsers also introduce a maintenance concern: grammar or generator changes may require contributors to regenerate or test language-specific code. The repository includes several such packages, but the upgrade instructions and compatibility policy are not included in the README.

Release cadence, LGPL-3.0, and maintenance cost

The repository is not archived, and its last push was on 2026-10-14. That status supports treating it as a project with current repository activity, although the README does not publish a formal support policy or response-time commitment. Recent releases include `v4.0.0` on 2026-09-07, `v4.1.0` on 2026-10-09, and a nightly distribution on 2026-10-12. This sequence shows recent versioned and nightly artifacts, but it does not reveal how breaking changes are managed between them.

The license is `LGPL-3.0`. That identifier is material for organizations considering GumTree as a library or distributing an integrated tool, but the repository README does not summarize how a particular deployment satisfies the license. This article does not provide legal advice. An adopter should inspect `LICENSE` and determine how the intended linking, modification, and distribution model affects its obligations.

The upgrade burden is likely to involve more than replacing a library version when a tool depends on GumTree. Language support, generated parser modules, Git integration, and the consumed edit format all need verification across major versions such as `v4.0.0` and `v4.1.0`. The repository contains `CHANGELOG.md`, but the README does not summarize whether schema, API, or parser compatibility was preserved. No documented rollback procedure appears in the README, so version compatibility must be checked before automation is updated.

GumTree adoption checks for Java and Git tooling

GumTree is best suited to a Java developer building analysis, refactoring, review, or research tooling that needs syntax-aligned edits. The documented move and rename detection offers a concrete reason to choose it over a line differ, and the README explicitly points to Git integration. The project's language list also covers several common programming languages, although it is not exhaustive.

It is a poor fit for someone who expects the README alone to provide installation, a complete command-line tutorial, upgrade instructions, or a stable integration contract. Those details are absent here and are delegated to the wiki, discussions, and repository files. It is also a poor fit when raw textual fidelity matters more than structural meaning or when the required language is not documented as supported.

The first checks should be concrete. Read `Getting Started`, verify the target language on `Languages`, and inspect `VCS-Integration` for the intended Git workflow. Then review the output contract in the relevant documentation or source API before embedding GumTree. The release evidence and current repository activity are favorable signals, but the adoption decision still depends on those language, output, licensing, and compatibility checks.

Editorial conclusion

GumTree is appropriate for developers, tool authors, and researchers who need structural source code diffs or Git integration, especially when moved elements make text output misleading. It is less suitable for users who need a self-contained installation guide, documented upgrade procedure, or language coverage beyond the documented set. Before adoption, verify the language-specific guidance in the wiki, the exact edit output required by the consuming tool, and whether the LGPL-3.0 obligations fit the intended distribution model.

Frequently asked questions

Which programming languages does GumTree support?

The README lists C, Java, JavaScript, Python, R, and Ruby. It directs users to the `Languages` wiki page for more details.

How does GumTree differ from a line-based diff tool?

GumTree aligns edit actions with syntax and can detect moved or renamed elements. A conventional text diff primarily reports inserted and deleted text locations.

Can GumTree be integrated with Git?

The README links to a `VCS-Integration` wiki page and presents Git integration as a supported capability. It does not include the integration commands or configuration in the README itself.

Official sources

  1. GumTreeDiff/gumtree on GitHub
  2. License: LGPL-3.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/gumtreediff-gumtree.svg)](https://hysenlabs.com/projects/gumtreediff-gumtree)