昨天,我发布了一个关于如何将git存储库从我的一台机器克隆到另一台机器的问题,如何从另一台机器上'git clone'?。
我现在能够成功地将Git存储库从我的源(192.168.1.2)克隆到我的目标(192.168.1.1)。
但是当我编辑一个文件,一个git commit -a -m "test"
和一个git push
,我得到这个错误在我的目的地(192.168.1.1):
git pushhap@192.168.1.2's password:Counting objects: 21, done.Compressing objects: 100% (11/11), done.Writing objects: 100% (11/11), 1010 bytes, done.Total 11 (delta 9), reused 0 (delta 0)error: refusing to update checked out branch: refs/heads/mastererror: By default, updating the current branch in a non-bare repositoryerror: is denied, because it will make the index and work tree inconsistenterror: with what you pushed, and will require 'git reset --hard' to matcherror: the work tree to HEAD.error:error: You can set 'receive.denyCurrentBranch' configuration variable toerror: 'ignore' or 'warn' in the remote repository to allow pushing intoerror: its current branch; however, this is not recommended unless youerror: arranged to update its work tree to match what you pushed in someerror: other way.error:error: To squelch this message and still keep the default behaviour, seterror: 'receive.denyCurrentBranch' configuration variable to 'refuse'.To git+ssh://hap@192.168.1.2/media/LINUXDATA/working! [remote rejected] master -> master (branch is currently checked out)error: failed to push some refs to 'git+ssh://hap@192.168.1.2/media/LINUXDATA/working'
我正在使用两个不同版本的Git(远程计算机上为1.7,本地计算机上为1.5)。这是一个可能的原因吗?