プロが教えるわが家の防犯対策術!

gitサーバーの動作ができていることを

netstat -lpn -A inet

このコマンドを実行して

root@ubuntu:~/hogetest# netstat -lpn -A inet
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3400/cupsd
tcp 0 0 0.0.0.0:9418 0.0.0.0:* LISTEN 1032/git-daemon
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1493/dnsmasq
udp 0 0 0.0.0.0:59866 0.0.0.0:* 980/dhclient
udp 0 0 0.0.0.0:59361 0.0.0.0:* 655/avahi-daemon: r
udp 0 0 127.0.1.1:53 0.0.0.0:* 1493/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 980/dhclient
udp 0 0 0.0.0.0:631 0.0.0.0:* 1035/cups-browsed
udp 0 0 0.0.0.0:5353 0.0.0.0:* 655/avahi-daemon: r


これでgit-daemonが動作していることを確認しています。

なお、/etc/default/git-daemonの内容は次のようにしています。

root@ubuntu:/etc/default# cat git-daemon
# Defaults for git-daemon initscript
# sourced by /etc/init.d/git-daemon
# installed at /etc/default/git-daemon by the maintainer scripts

#
# This is a POSIX shell fragment
#

GIT_DAEMON_ENABLE=true
GIT_DAEMON_USER=gitdaemon
GIT_DAEMON_DIRECTORY=/var/cache/git

# Additional options that are passed to the Daemon.
GIT_DAEMON_OPTIONS=""



とりあえず、こちらのWEBページの内容に沿ってgit cloneをおこなってみました。
http://d.hatena.ne.jp/itmammoth/20130604/1370362 …



”GIT_DAEMON_DIRECTORY=/var/cache/git”

この設定なので、/var/cache/gitフォルダ下に"myrepo.git"というリポジトリを作成しました。


それで、/root/hogetestフォルダ下に

git clone git://192.168.163.129/myrepo.git

とやってみたのですが、
次のようなエラーがでてクローンができない状態です。



root@ubuntu:~/hogetest# git clone git://192.168.163.129/myrepo.git
Cloning into 'myrepo'...
fatal: remote error: access denied or repository not exported: /myrepo.git



このようなエラーの解決方法をご教示頂きますようお願い致します。


なお、ubuntuの日本語エディションをVMplayer6で動作させています。

A 回答 (1件)

>”GIT_DAEMON_DIRECTORY=/var/cache/git”


>この設定なので、/var/cache/gitフォルダ下に"myrepo.git"というリポジトリを作成しました。

他の変数もあるようです。

/etc/init.d/git-daemonを覗くとGIT_DAEMON_BASE_PATHというものが……。
で、検索すると……
http://www.mybrains.net/mywiki/index.php?GitTips
とか。

GIT_DAEMON_DIRECTORYが作業ディレクトリ、GIT_DAEMON_BASE_PATHがリポジトリのベースとなるディレクトリの指定…ということでしょうか。
# man git-daemon で確認を。
    • good
    • 0
この回答へのお礼

回答頂きありがとうございます。

紹介して頂いたWEBサイトの/etc/init.d/git-daemon設定ファイルに”GIT_DAEMON_BASE_PATH=/var/cache/git”と追加してクローンできるようになりました。

助かりました。

お礼日時:2014/03/27 14:41

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!