【发布时间】:2018-12-12 11:11:03
【问题描述】:
所以我正在尝试将 github 分支同步到我网站的两个部分,理论上我的 github 中的主分支应该与我的网站 tinyweatherstation.com 同步,而 beta 分支应该与 beta.tinyweatherstation.com 同步,我已经成功地让 post-receive 钩子与 master 分支一起工作,但是当它用于 beta 分支时:
git remote add live_beta ssh://wesley@tinyweatherstation.com/var/www/tinyweatherstation.com.git
git push live_beta +beta:refs/heads/beta
我得到错误:
Enter passphrase for key '/c/Users/WesleyN/.ssh/id_rsa':
Counting objects: 999, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (967/967), done.
Writing objects: 100% (999/999), 5.04 MiB | 529.00 KiB/s, done.
Total 999 (delta 360), reused 0 (delta 0)
remote: Resolving deltas: 100% (360/360), done.
remote: fatal: You are on a branch yet to be born
To ssh://tinyweatherstation.com/var/www/beta.tinyweatherstation.com.git
* [new branch] beta -> beta
post 接收钩子看起来像这样...
#!/bin/sh
GIT_WORK_TREE=/var/www/beta.tinyweatherstation.com/html git checkout -f
我已经提交了这个分支(测试版),所以我知道它在那里,所以请帮助...
【问题讨论】:
-
错误来自 post-receive 钩子。但是,在您向我们展示实际的 post-receive 挂钩之前,我们只能猜测发生了什么。
-
我用接收钩子编辑了帖子