[問題] git-daemon無法push?

看板Linux作者 ( )時間15年前 (2011/03/28 01:54), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.19.80
文章代碼(AID): #1DZtdNcV (Linux)