这是我目前挂在公司服务器上的裸仓库中的git push origin master
钩子:
这个钩子推送到Assembla.我需要的是当有人将更改推送到我们服务器上的那个分支时,只推送一个分支(主,理想),并忽略推送到其他分支.是否可以从裸仓库中选择分支并仅将该分支推送到Assembla?
我有一个post-receive钩子脚本坐在我正在推动的远程仓库上 git reset --hard
像这样的东西:
$ git push opal
Counting objects: 74, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (53/53), 16.68 KiB, done.
Total 53 (delta 20), reused 0 (delta 0)
remote: warning: updating the current branch
remote: HEAD is now at 88f1e35 tweak lavalamp styles
Run Code Online (Sandbox Code Playgroud)
我在这里不明白的是 - 遥控器说头部现在在XXX但是当我登录服务器时 - 远程工作副本根本没有更新!
任何的想法?
我正在使用Git来管理我的网站的源代码和部署,目前在同一个盒子上运行测试和实时网站.最初在这个资源http://toroid.org/ams/git-website-howto之后,我想出了以下post-receive钩子脚本来区分推送到我的实时站点并推送到我的测试站点:
while read ref
do
#echo "Ref updated:"
#echo $ref -- would print something like example at top of file
result=`echo $ref | gawk -F' ' '{ print $3 }'`
if [ $result != "" ]; then
echo "Branch found: "
echo $result
case $result in
refs/heads/master )
git --work-tree=c:/temp/BLAH checkout -f master
echo "Updated master"
;;
refs/heads/testbranch )
git --work-tree=c:/temp/BLAH2 checkout -f testbranch
echo "Updated testbranch"
;;
* )
echo "No update known for $result"
;;
esac …Run Code Online (Sandbox Code Playgroud) 我们目前正在谈论通过rsync部署网站.但是,在rsyncing期间,应用程序处于不一致状态,因为某些文件可能已经同步,而其他文件仍然保留旧版本的权利?人们如何处理这个问题?我猜通过svn/git/cvs部署时存在同样的问题.我应该关闭网站,rsync,然后再次打开?或者人们只是忽略这个不一致问题?