这是我目前挂在公司服务器上的裸仓库中的git push origin master
钩子:
这个钩子推送到Assembla.我需要的是当有人将更改推送到我们服务器上的那个分支时,只推送一个分支(主,理想),并忽略推送到其他分支.是否可以从裸仓库中选择分支并仅将该分支推送到Assembla?
我有一个使用gitolite设置的中央git repo.
我想设置一个钩子,这样每当用户推送到repo时,它会执行其他地方的拉动,然后进行一些自动化测试.
到目前为止,我只想表现它.
在hooks目录中,我在更新后创建了以下脚本名称:
#!/bin/sh
cd /home/git/www/epicac
git pull
Run Code Online (Sandbox Code Playgroud)
当我使用./post-update调用此脚本时,它完全符合我的要求.
但是,每当我挂钩时自动调用它,我得到:致命:不是git存储库:'.'
知道为什么会这样吗?
我已经建立了与GIT我EC2实例中的一个,并用后收到钩我把它部署到我的服务器与本教程.这是我的控制台的输出:
$ git push production master
git@example.com's password:
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 2.51 KiB, done.
Total 19 (delta 14), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
To git@184.169.147.123:halftown.git
5d5e809..eb30e51 master -> master
error: failed to push some refs to 'git@example.com:git_application.git'
Run Code Online (Sandbox Code Playgroud)
如果您还需要其他任何帮助我解决此问题,请与我们联系.