Skip to content

git hacks

holzkohlengrill edited this page Dec 15, 2023 · 2 revisions

git/GitHub tools and hacks

Export GitHub issues to html

Exports GitHub issues including comments to .html (one per issue).

This solution involves some tools to be installed which not cool but at present the best way to do this.

The good thing of using the GitHub CLI is that it works (unlike all other tools) with GitHub Enterprise (gh auth login --hostname <hostname>) and ssh 👍.

Limitations / future work

Attachments and embedded images will not be included.

Installation

  1. Download the ansi2html.sh script
  2. Download and install the GitHub CLI tool
  3. Get your total number of commits (GitHub starts counting from 1)
  4. Fire up a UNIX shell and enter the following command:

Usage

for i in {1..<ENTER_TOTAL_NUMBER_OF_COMMITS>}; do gh issue view $i | ./ansi2html.sh --palette=solarized > ./issue#$i.html; done

Details

  • gh will show the issue view of each commit (number) of the loop
  • The result gets piped into ansi2html.sh to preserve colours and output an html
  • The output is a file named issue#i.html (where i is the corresponding issue number
Clone this wiki locally