Skip to content

garovu/gitdiffgohtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitdiffgohtml (gdgh)

A zero-dependency Go CLI that converts git diffs into styled, self-contained HTML pages.

Supports line-by-line and side-by-side views with automatic light/dark theming.

Preview

gitdiffgohtml preview

Features

  • Parse git diff output from command, file, or stdin
  • Render in line or side layout
  • Auto light/dark theme support
  • Optional file-level summary
  • Output as HTML or JSON

Install

go install github.com/garovu/gitdiffgohtml/cmd@latest

Or build from source:

git clone https://github.com/garovu/gitdiffgohtml
cd gitdiffgohtml
go build -o gdgh ./cmd

Usage

gdgh [flags] [-- git diff args]
Flag Description Default
-s, --style Output style: line, side line
-cs, --colorScheme Color scheme: auto, dark, light auto
--summary Show file summary true
-t, --title Page title for HTML output "Diff to HTML"
-f, --format Output format: html, json html
-i, --input Input source: file, command, stdin command
-o, --output Output destination: preview, stdout preview
-F, --file Write output to file
-v, --version Show version
-h, --help Show help

Examples

# Diff last commit and open preview in browser
gdgh

# Diff last 3 commits with rename detection
gdgh -- -M HEAD~3

# Side-by-side view, write to file
gdgh -s side -F output.html -- HEAD~1

# Read from a diff file
gdgh -i file my.diff

# Pipe from stdin, side-by-side
cat my.diff | gdgh -i stdin -s side

# Output as JSON
gdgh -f json -o stdout -- HEAD~1

License

MIT

About

Convert git diff to html using Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages