好吧,我在我的機器上安裝了一個repo安裝程序,我正在使用它來將更新推送到文件服務器上的某個位置。我用下面的克隆:使用GIT更新本地文件服務器上的文件
機器上的dir開始:
git init
git add .
git commit -m 'initial'
cd ../
然後克隆到文件服務器
git clone -bare testdir fileserverip/testdir
此克隆很好,但我該如何使用GIT更新?與我以前使用GIT的經驗不同,我不想通過SSH或其他方式進行連接,因此如何設置推送?
編輯:
由的Makis在答覆中提到修改我的設置後,我得到git push
james-macbook:test2 james$ git push
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 506 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To xxxxxxxxxxxxxxxxxxx
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'xxxxxxxxxxxxxxxxxxx'
james-macbook:test2 james$
任何人以下錯誤知道這意味着什麼?
編輯:剛發現這個,認爲這是我所需要的。 http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/
感謝
只是認爲這可能更適合ServerFault。不確定? – 2011-02-04 15:37:45
這個問題看起來像你的遠程回購不光。 – Makis 2011-02-04 17:33:45