因为我创建了一个共享 repo 文件夹,路径为://web1/www 在另一台 PC 中,我创建了一个文件夹,然后打开了 bash,我做了:
$ git clone //web1/www
然后在新创建的 repo 文件夹中:
$ git status
# On branch master
nothing to commit, working directory clean
我添加了一个文件,然后:
$ git add .
$ git commit -m 'new file added'
$ git push origin master
但是,这就是我在下面得到的错误,知道我现在该怎么办吗?
$ git push origen master
fatal: 'origen' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
s.ali@WEB2 /d/ketab projects/www (master)
$ git remote -v
origin //web1/www (fetch)
origin //web1/www (push)
s.ali@WEB2 /d/ketab projects/www (master)
$ git push origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 257 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
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 inconsist
ent
remote: error: with what you pushed, and will require 'git reset --hard' to matc
h
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'.
PS:我在 Windows 7 本地网络上,使用域而不是工作组