Я установил следующий пост-получение:
$ cat .git/hooks/post-receive
#!/bin/env sh
git checkout -f
, который является исполняемым:
$ l .git/hooks/post-receive
-rwx--x--x 1 nils nils 30 11. Jan 13:17 .git/hooks/post-receive
Поэтому, когда я нажимаю на него с локального компьютера, он должен оформить заказ и получитьизменения, которые я сделал локально.Но это не так:
Local:
$ cat > testfile
hello world
$ git add testfile && git commit -m "added testfile" && git push production master
[master 9f5232d] added testfile
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 testfile
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 290 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
To ssh://[…]/
88ce501..9f5232d master -> master
Впоследствии на удаленной машине:
$ git status --short
D testfile
Так что в его рабочем дереве нет тестового файла
$ git checkout -f
$ git status
# On branch master
nothing to commit (working directory clean)
Есть идеи, что может быть не так?