Progress:
TIER 2 · MODULE 21· Intermediate

git instaweb

Browse your repo locally on 127.0.0.1.

🎯 What & why

git instaweb spins up a local gitweb instance against the current repository so you can browse history, blobs, and refs in a real web UI without any server setup. It is the fastest path from 'I want to look at my repo in a browser' to actually doing it.

🧠 Mental model

A throwaway HTTP daemon plus gitweb CGI, configured on the fly and pointed at your repo. You start it, it opens a browser at 127.0.0.1, you stop it, nothing persists.

🛠️ Synopsis

git instaweb [--local] [--httpd=<httpd>] [--module-path=<path>]
              [--port=<port>] [--browser=<browser>]
              [--start | --stop | --restart]

🎚️ Switches & options

FlagWhat it does
--httpd=<httpd>Pick the daemon: lighttpd, apache2, mongoose, plackup, webrick.
--port=<n>Bind port (default 1234) on 127.0.0.1.
--browser=<browser>Override which browser command to launch.
--startStart the daemon without launching a browser.
--stop⚠️ Kill the running instaweb daemon for this repo.
--restartBounce the daemon, useful after config changes.
--localBind to loopback only; defensive default for laptops.

💡 Use cases

🧪 Examples

Start with lighttpd on default port
git instaweb --httpd=lighttpd --start
Custom port, no browser launch
git instaweb --httpd=webrick --port=8080 --start
Open in a specific browser
git instaweb --httpd=mongoose --browser=firefox
Stop the running instance
git instaweb --stop

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.