我已經通過第一副本開始的git的存儲庫,然後「git的承諾」,但是當我做「混帳推」 我收到此錯誤:但它表示「拒絕更新結賬科'?如何修復錯誤時混帳推遭到拒絕
$ git push
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 2.72 KiB, done.
Total 13 (delta 5), 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 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 ssh://[email protected]/home/michae/scripts
! [remote rejected] master -> master (branch is currently checked out)
這是什麼意思?
我搜索和閱讀 How to cope with "rejected" on git push?
我甚至嘗試「混帳推起源HEAD」這給了我同樣的錯誤:
我做了'git clone --bare path/to/original/repo path/to/bare/repo.git'。但是當我做'git remote set-url origin path/to/bare/repo.git'時,我得到了致命的結果:沒有這樣的遠程'起源' – michael
@michael你有什麼遙控器? 'git remote'顯示了什麼?通常,當您從回購單中克隆時,原始文件被設置爲「原始」,但可能會有所不同。 –