Git2PlantUML is a tool that reads git repository commits and renders them as PlantUML diagrams.
If you are studying or teaching git, this tool can be extremely useful for you to demo internals of git structures.
Check out my posts about internal git structures (git2plantuml used to visualize data):
- How actually git tracks objects. Snapshotting and the Illusion of git Diff.
- Git branches, where do they lead ?
./gradlew clean build
./gradlew run
> Task :run
[main] INFO io.github.tsypuk.App - HEAD3150d02c3ae03060a7614cee66c2466b4bc28614
[main] INFO io.github.tsypuk.App - refs/heads/main3150d02c3ae03060a7614cee66c2466b4bc28614
BUILD SUCCESSFUL in 1s
The output of elements are fully configurable in the config.yaml file. You can customize based on you need amount of hash digits, branches, whether to show inner deep dive git objects or commits only, group arrows to same object into single line, etc.
repo-path: "/tmp/gitexplore"
result-file: "/tmp/result.plantuml"
show-branches: true
console-debug: false
plantuml-jekyll: false
show-tree-blob: true
single-arrow-tree: false
hash-limit: 8
resolve:
- "main"
Location of your git repo
location of generated plantuml file (file will be overwritten/recreated)
branches are shown on top of commit
besides FileOutput, will also print to console generated format
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :GitUml.main()
++++
<center>
++++
[plantuml, 29fca3c4-735e-4ec6-a2cc-779c6ba99009, png, title="Git repository snapshot: 3 commits, 3 trees, 2 blobs, 2 refs: HEAD,refs/heads/main", width=1000, height=1000]
....
class Commit3 <<(C,orange)>> {
-sha: 3150d02c
--
message: added 3rd file
--
timestamp: 1677327539
}
class Commit2 <<(C,lightblue)>> {
will generate one more file, wrapped with jekyll-specific headers
represents Commit, Tree, Blob objects. On false - Commit only
If there are multiple tree references to the same Blob will show as single connection
Default to 8. How many digits from sha will be included
list of branches (master or main is preferred)
Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.