git-daemon無法push? - Linux

Genevieve avatar
By Genevieve
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

--
Tags: Linux

All Comments

grep 和 big5 中文字

Victoria avatar
By Victoria
at 2011-03-27T14:28
這個問題我 google 了幾天了都找不到解決方案 所以決定到版上來問問看 因為要做研究的關係我蒐集很多 .html 的網頁資料 (大概600筆左右) 全部都是 big5 中文碼 我想用 grep 抓關鍵字分析資料 沒想到 grep 居然抓不到 big5 的中文字 (utf-8 的中文和日文都抓得到) ...

軟體跨帳號使用

Emily avatar
By Emily
at 2011-03-27T11:50
小弟使用的是Fedora 4 想要把某軟體從A帳號搬到B帳號共用 請問要怎麼設定呢 感謝先 - ...

上bbs都會自動斷線?

Sarah avatar
By Sarah
at 2011-03-27T10:29
我在以下的環境交叉試驗上bbs都會自動斷線 1.ubuntu 10.10 或fedora 14下 2.用telnet或ssh 3.使用putty等軟體 或 firefox中的bbsfox附加元件 只要不是在bbs上持續操作 先操作其他程式一會後,再切換看bbs時,大概連續操作十幾秒鐘畫面就會卡住 ...

灌winxp(已灌好ubuntu)

Elma avatar
By Elma
at 2011-03-27T09:07
我知道可以先灌winxp ,再win7,再ubuntu,我桌機這樣做 我nb是七年前的,我現在灌ubuntu,不想在wine上弄,也不想 用模擬的,想說直接灌,我是直接拿winxp光碟來灌嗎?謝謝回答 -- 「那」跟「哪」有那麼難嗎?難道「哪」消失了嗎? 你去那裡 跟 你去哪裡 意思差很多說 ...

Gentoo Linux - LiveDVD 11.0

Mary avatar
By Mary
at 2011-03-27T04:30
Gentoo Linux - LiveDVD 11.0 Posted on March 8, 2011 by Joshua Saddler Software in the making edition Gentoo Linux is proud to announce the availability ...