Today I Learned -- Git's built-in website
Today I learned that Git ships with a built-in web interface for a code repository. Here’s how to set it up!
- Open a terminal
- Navigate to a Git repository on your computer
- Start the instaweb server with
git instaweb --local --httpd=webrick
- Open a web browser to
localhost:1234
to explore your git repository.
On my system (Ubuntu 24.04 in WSL) I also had to
sudo apt install libcgi-session-perl
since the Git Web server uses CGI scripts on its backend.
And that’s it!
I thought it was really neat to see how smooth the setup was. I’ve previously seen these types of Git repositories hosted online (e.g. the RSS reader TTRSS), so it was fun to learn how those work behind the scenes.
This post is licensed under CC BY 4.0 by the author.