[英]Git hook creation - You are on a branch yet to be born
So im setting up a git and following this guide http://toroid.org/ams/git-website-howto . 因此,即时通讯设置了git并遵循本指南http://toroid.org/ams/git-website-howto 。
I get as far as this command: 我得到的命令如下:
# GIT_WORK_TREE=/home3/trncprop/public_html/tpcapp git checkout -f
And get the following error message 并得到以下错误信息
fatal: You are on a branch yet to be born
Does anyone know what I am doing wrong? 有人知道我在做什么错吗?
Thanks in advance! 提前致谢! Littleswany Littleswany
That command is supposed to be in a hook, not to be executed directly in website.git
该命令应该挂在钩子上,而不是直接在website.git
执行
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/www.example.org git checkout -f
$ chmod +x hooks/post-receive
That means you need to create a website.git/hooks/post-receive file, with that command in it, and make it executable. 这意味着您需要创建一个website.git / hooks / post-receive文件,并在其中包含该命令,并使它可执行。
That will allow you to push commits top that bare repo (website.git), which will trigger the post-receive hook, and will checkout the repo content into a different working tree. 这将允许您将提交推送到裸仓库(website.git)的顶部,这将触发接收后钩子,并将仓库的内容检出到另一个工作树中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.