git-daemon無法push? - Linux

By Genevieve
at 2011-03-28T01:54
at 2011-03-28T01:54
Table of Contents
Dear all,
想請教一下各位,
我的環境是Ubuntu 10.04
我根據下列網址的步驟執行安裝並執行git-daemon-run
http://www.gaojinbo.com/ubuntu9-0-4%E4%B8%8B%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AEgit-daemon.html
short url:http://tinyurl.com/4v3lo9w
(大致上差不多,實際上參考很多網頁的資料)
/etc/sv/git-daemon/run的執行部分修改為下面
exec chpst -ugitdaemon /usr/lib/git-core/git-daemon –verbose \
–enable=receive-pack –export-all \
–base-path=/var/cache/git/
基本上client端要clone下來都沒有問題
但是push的時候會出現幾種狀況
一時也列不出來
所以想請教一下各位,
1.因以gitdaemon的身分執行git-daemon,那base-path下的git repos資料夾
的owner是否也需要為gitdaemon? 檔案與資料夾權限開755?
2.此外 我也參考了這篇問與答的資料
http://stackoverflow.com/questions/792611/receive-pack-service-not-enabled-for-git
short url:http://tinyurl.com/4qa532a
的答案部份
Simply run
git daemon --reuseaddr --base-path=. --export-all --verbose
--enable=receive-pack
(on computer A, instead of the original git daemon command), and the push
works.
Note that you have to then run
git reset --hard
on computer A to make it "see" the changes from computer B.
Post Script
The problem with doing a hard reset is that it overwrites whatever local
changes you had on computer A.
Eventually I realized it would make much more sense to have a separate
repository (a bare clone) that doesn't have any files in it, then have
computer B push to it and computer A pull from it. This way it can work both
ways and merge all the changes in a smooth fashion. You can even have two
bare clones, one on each computer, and push-pull between them.
但是還是搞不太定
有人可以幫我解釋一下他的回答以及用意是什麼嗎?
謝謝:)
--
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
國 立 聯 合 大 學
(理工/電資/管理/技術/客家)院所 招生中
National United University
───────────────────────────────────
首頁 http://www.nuu.edu.tw BBS telnet://uun.twbbs.org
--
想請教一下各位,
我的環境是Ubuntu 10.04
我根據下列網址的步驟執行安裝並執行git-daemon-run
http://www.gaojinbo.com/ubuntu9-0-4%E4%B8%8B%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AEgit-daemon.html
short url:http://tinyurl.com/4v3lo9w
(大致上差不多,實際上參考很多網頁的資料)
/etc/sv/git-daemon/run的執行部分修改為下面
exec chpst -ugitdaemon /usr/lib/git-core/git-daemon –verbose \
–enable=receive-pack –export-all \
–base-path=/var/cache/git/
基本上client端要clone下來都沒有問題
但是push的時候會出現幾種狀況
一時也列不出來
所以想請教一下各位,
1.因以gitdaemon的身分執行git-daemon,那base-path下的git repos資料夾
的owner是否也需要為gitdaemon? 檔案與資料夾權限開755?
2.此外 我也參考了這篇問與答的資料
http://stackoverflow.com/questions/792611/receive-pack-service-not-enabled-for-git
short url:http://tinyurl.com/4qa532a
的答案部份
Simply run
git daemon --reuseaddr --base-path=. --export-all --verbose
--enable=receive-pack
(on computer A, instead of the original git daemon command), and the push
works.
Note that you have to then run
git reset --hard
on computer A to make it "see" the changes from computer B.
Post Script
The problem with doing a hard reset is that it overwrites whatever local
changes you had on computer A.
Eventually I realized it would make much more sense to have a separate
repository (a bare clone) that doesn't have any files in it, then have
computer B push to it and computer A pull from it. This way it can work both
ways and merge all the changes in a smooth fashion. You can even have two
bare clones, one on each computer, and push-pull between them.
但是還是搞不太定
有人可以幫我解釋一下他的回答以及用意是什麼嗎?
謝謝:)
--
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
國 立 聯 合 大 學
(理工/電資/管理/技術/客家)院所 招生中
National United University
───────────────────────────────────
首頁 http://www.nuu.edu.tw BBS telnet://uun.twbbs.org
--
Tags:
Linux
All Comments
Related Posts
grep 和 big5 中文字

By Victoria
at 2011-03-27T14:28
at 2011-03-27T14:28
軟體跨帳號使用

By Emily
at 2011-03-27T11:50
at 2011-03-27T11:50
上bbs都會自動斷線?

By Sarah
at 2011-03-27T10:29
at 2011-03-27T10:29
灌winxp(已灌好ubuntu)

By Elma
at 2011-03-27T09:07
at 2011-03-27T09:07
Gentoo Linux - LiveDVD 11.0

By Mary
at 2011-03-27T04:30
at 2011-03-27T04:30