Управление сайтом с помощью git + post-receive hook: ошибка, выдвигающая изменения

Вопрос: Как мне передать локальные коммиты на сервер разработки, если это рабочее дерево не пустое?

Моя ситуация:

I set up git on my development server so that when I push local changes, they are added to a detached working tree (as described here and much like this post). I then experienced problems running git on the dev server (eg, git status) because git could not find the working tree. I asked around SO and got the tip off that I needed to set bare = false in my config file and specify the worktree. Sweet.

Но теперь, когда я пытаюсь отправить свои коммиты на сервер разработки, я получаю эту ошибку:

$ git push origin master
[email protected]'s password:
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 2.56 KiB, done.
Total 18 (delta 8), 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]/xxx/xxx/xxxxxx.git
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'ssh://[email protected]/xxx/xxx/xxxxxx.git'

я вижу этоу этого другого пользователя была такая же проблема, К сожалению, решение, которое работало для него, устанавливалоbare = true в его конфигурации, которая воссоздала бы проблему, которую я имел в шаге 3 выше.

Сообщение об ошибке говорит

You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn'

В моем случае это нормально для меня, чтобы сделать это? Это звучит хорошо для меня, но я еще недостаточно знаком с git, чтобы распознать плохую идею, когда она возникнет ...

EDIT

Просто чтобы прояснить, я уже добавил хук пост-получения, и он работает гладко. Проблема в том, что мне, кажется, приходится выбирать междуbare=true (и возможность отправки на сервер разработки) иbare=false (и возможность запускать команды git на сервере dev).

Ответы на вопрос(4)

Ваш ответ на вопрос