回答
我認爲你要找的是git instaweb
。
默認情況下,它使用lighttpd
,但任何其他web服務器如webrick
也應該工作。
我喜歡的WEBrick,因爲它是非常方便(我有ruby
和webrick
寶石安裝)
例子:
# Starts a web server on port 1234 and opens up a web browser
git instaweb --httpd=webrick
# To stop webrick
git instaweb --httpd=webrick --stop
你應該能夠在配置instaweb
設置你的.git/config
或~/.gitconfig
和僅運行git instaweb --start
和git instaweb --stop
來控制instaweb:
[instaweb]
local = true
httpd = webrick
port = 1234
browser = chromium
UPDATE:
這 alberthier在他的回答中提到git-webui,實際上是相對於默認instaweb
和安裝更豐富的UI也確實簡單。
只是瀏覽文件和修訂git instaweb
是正確的解決方案。
另外,如果你想建立一個特設混帳分享工作和一些同事服務器(推/拉)(其中hg serve
也允許你這樣做),你可以使用:
git daemon --reuseaddr --base-path=. --export-all --verbose --enable=receive-pack
你的同事將與類似使用它:
git clone git://<ip-address>/.git project
加入1:
如果你希望能夠到將推送到此服務器,您需要添加--enable=receive-pack
選項(感謝下面的Dominik)。
加2:
它只是發生在我身上,所以我把它添加到答案:-),如果您使用的是基於紅帽- Linux發行版(RHEL,CentOS的,等等。),並有一個錯誤"git: 'daemon' is not a git command."
,那麼你需要安裝一個單獨的包吧:
sudo yum install git-daemon
得到'致命的:遠程錯誤:訪問被拒絕或版本庫未導出:REPO'使用Git服務器。在服務器端:''receive-pack':服務沒有爲DIR/REPO啓用。 解決方法是添加'--enable = receive-pack'(請參閱@ itsadok的[answer](http://stackoverflow.com/a/792621/1168315)) – Dominik 2016-08-15 11:32:43
謝謝@Dominik,我會將此提示添加到回答。沒有這個,你可以拉,但不能推。 – 2016-08-18 13:32:12
的git-Web用戶界面是一個Git擴展,它提供了基於Web的用戶界面和克隆/從其他計算機
拉動能力https://github.com/alberthier/git-webui
$ cd my_git_repo
$ git webui
其他人可以
$ git clone http://<ip-of-your-computer>:8000/ repoclone
或
$ git pull http://<ip-of-your-computer>:8000/
- 1. git相當於hg -R?
- 2. git相當於hg mq?
- 3. git相當於'hg share'?
- 4. 相當於「hg cat」或「svn cat」的git
- 5. hg commit -u的git相當於什麼?
- 6. 汞相當於hg qdiff?
- 7. hg相當於svn info
- 8. stop hg serve on os x
- 9. 有沒有相當於gg-walk next/git-walk prev in hg?
- 10. hg擱置相當於git存儲丟棄
- 11. Mercurial hg serve命令的問題
- 12. hg serve:如何使它可用於克隆?
- 13. git相當於「svn -v status」
- 14. 「svn up」相當於git
- 15. git-shell相當於svnserve -r?
- 16. Libgit2sharp相當於'git gc'?
- 17. Hg-Git和Mercurial的當前版本(2)?
- 18. Git類似於Hg的Bigfiles Extension?
- 19. hg充當Windows服務
- 20. git submodule from Hg repo?
- 21. hg git命令包
- 22. git的Mercurial相當於什麼?
- 23. Subversion相當於Git的'show'命令?
- 24. 'rm'+'svn update'在Git中相當於?
- 25. GIT commit命令相當於SVN命令
- 26. 相當於git checkout branch_name在LibGit2Sharp上
- 27. git相當於svn ls -R -v?
- 28. 相當於git difftool -y與libgit2sharp?
- 29. 相當於git diff --unified = 0與libgit2sharp?
- 30. SVN:外部在Git中相當於?
這似乎是http://stackoverflow.com/questions/438163/whats-the-best-web-interface-for-git-repositories – 2013-03-27 22:26:46
@YounElan的重複:我覺得這是一個單獨的問題。你鏈接到的問題是關於在本地設置GitHub克隆,而這個問題是關於啓動一個短期Web服務器,以便其他人可以推送/拉你。 – 2013-03-28 08:53:38