我在本地機器上有一個git repo。我將(最初)這個推到一個遠程(網絡服務器),我檢查遠程(在遠程),以便文件可以由Apache服務,我改變我的本地,commit -a
它的文件,然後我試着再推一遍我總是會遇到一個錯誤。這對於Svn來說非常簡單,我如何用git來做到這一點?git遠程錯誤
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 298 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/Dev
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 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]/var/www/UML/.git
! [remote rejected] Dev -> Dev (branch is currently checked out)
error: failed to push some refs to ......'
我沒有看到任何錯誤... – KingCrunch
由於這不是程序員的危險,如果您也發佈錯誤,那將是非常好的。 – moritz
[git push error'remote rejected \] master - > master(branch is currently checked out)']的可能重複(http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master - 主分支 - 是 - 目前進行確認的鷗) – manojlds