We commonly need a light option which opens a basic webpage on localhost. There are actually many browser based user interface for git repositories. Common reasons to avoid these are need of installation of too many packages, consumption of huge RAM etc. However, we are talking about quite basic option which is inbuilt present with git, too basic and another option which is slightly good looking and consumes slight more RAM than the first one.
Browser Based User Interface For Git Repositories : git-instaweb
Many new users are not aware of git-instaweb :
1 | https://git-scm.com/docs/git-instaweb |
Git has a CGI script called GitWeb that can be used for this. If you have iTerm2, Homebrew, ZSH installed on Mac and you have not configured git-instaweb, simply change directory to any repository :
---
1 2 3 | cd ~ ls -al cd your-any-git-repo |
If you run :
1 | git instaweb |
You will get this error :
1 | lighttpd not found. Install lighttpd or use --httpd to specify another httpd daemon. |
Install lighthttpd :
1 | brew install lighttpd |
Now run this :
1 | git instaweb --httpd=webrick |
If everything is fine, it will open a webpage like this on Safari or whatever your default browser is :
No configuration needed. To stop it, run :
1 | git instaweb --httpd=webrick --stop |
I do not know why you will not like this instant, light, web UI. May be you wanted more decorated thing. In that case, there is another option which is not hugely resource hungry :
Browser Based User Interface For Git Repositories : git-instaweb
There is git-webui :
1 | https://github.com/alberthier/git-webui |
Safest way is manual installation. You can clone that repo :
1 2 | cd ~ git clone https://github.com/alberthier/git-webui.git |
Then you can use git config
option to set alias to use command shortcut :
1 | git config --global alias.webui \!$PWD/git-webui/release/libexec/git-core/git-webui |
If you do not want to set git config
, you can browse your repo and run this (we cloned that git-webui at ~
to make it easy) :
1 2 | cd your-any-git-repo ~/git-webui/release/libexec/git-core/git-webui |
You have not installed anything. The above is running at port 8000.
Tagged With browser based git , git instaweb on windows