好吧,我在我的机器上安装了一个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