極簡易的 git server
¶極簡易的 git server
這是一篇,教你利用簡易的 Web server,開一個臨時的 git server。提供給區網內的人可以git clone。
¶Server
查看自己的 IP
~/code $ ifconfig
假設,在此取得的 ip 是192.168.94.87
先開一個簡易 Server
~/code $ python -m SimpleHTTPServer
# or ~/code $ php -S localhost:8000
先新增一個repo並且初始化成一個git bare。
~/code $ mkdir myRepo.git
~/code $ cd myRepo.git
~/myRepo.git $ git init --bare
然後再加上這一行[1]
~/myRepo.git $ git update-server-info
¶Client
現在就可以試著git clone 一下看看
~ $ git clone http://192.168.94.87:8000/myRepo.git
應該就可以成功了,但是經我自己的實驗,目前還無法git push。QQ
GIT over HTTP (GIT HTTP Transparent)
發表於
tags:
{ git }