草庐IT

receives

全部标签

Git post-receive hook 更新不同用户拥有的本地克隆

我正在尝试设置一个gitpost-receiveHook,以便在收到提交时更新机器上存储库的另一个克隆(即执行gitpulloriginmaster).我正在使用gitosis为存储库提供服务,因此我相信接收后Hook将作为gitosis用户运行,而我想在接收时更新的存储库归所有www-数据。我应该怎么做?我听说过setuid脚本,但我不确定这是否存在安全风险?如果这不是安全风险,我将如何去做呢?我猜想我会做一些事情,比如让www-data拥有脚本并使其在世界范围内可执行并启用setuid位?我想这个脚本几乎是无害的,因为它所做的只是更新存储库,但我想确定一下。谢谢!编辑:有没有办法使

git post-receive 无法正常工作

我有以下问题。我已经将“post-receive”更新为cd到某个目录,然后将repopull入以像这样部署它:#!/bin/bashcd/var/www/sitegitpulloriginmaster但是,每当我在本地机器上执行“gitpushoriginmaster”时,我都会得到以下信息:Countingobjects:5,done.Deltacompressionusingupto2threads.(etc..)remote:fatal:Notagitrepository:'.'然而,当我手动cd到/var/www/site并执行gitpulloriginmaster时,效果非

混帐克隆 : GnuTLS recv error (-9): A TLS packet with unexpected length was received

我正在尝试克隆一个git存储库,但在执行命令时收到以下错误:GnuTLSrecverror(-9):ATLSpacketwithunexpectedlengthwasreceived.我的客户端机器是Ubuntu14.04。 最佳答案 这是@IvanTernovtsiy所说的已知错误,但有解决方法从您的系统中删除当前的GITsudoapt-getpurgegit下载GITdebgit_1.9.1-1_amd64.deblink执行下载的DEB。 关于混帐克隆:GnuTLSrecverro

Git 'pre-receive' 钩子(Hook)和 'git-clang-format' 脚本可靠地拒绝违反代码风格约定的推送

让我们立即从我已经编写的pre-receive钩子(Hook)的片段开始:#!/bin/sh##format_bold='\033[1m'format_red='\033[31m'format_yellow='\033[33m'format_normal='\033[0m'##format_error="${format_bold}${format_red}%s${format_normal}"format_warning="${format_bold}${format_yellow}%s${format_normal}"##stdout(){format="${1}"shiftpri

git - git-receive-pack 是如何工作的?

我想知道如何git-receive-pack有效,因为我完全不知道它会发生什么。谁能揭开这个谜团? 最佳答案 Accordingtothemanpage:http://schacon.github.com/git/git-receive-pack.htmlThiscommandisusuallynotinvokeddirectlybytheenduser.TheUIfortheprotocolisonthegitsend-packside,andtheprogrampairismeanttobeusedtopushupdatesto

混帐 1.8 : it push error: dst ref refs/heads/master receives from more than one src

git1.8的另一个问题:$gitpusherror:dstrefrefs/heads/masterreceivesfrommorethanonesrc.error:failedtopushsomerefsto'gitosis@xxx.xx:xxx.git'建议?它在升级到1.8之前一直有效。$gitremote-vorigingitosis@xxx.xx:xxx.git(fetch)origingitosis@xxx.xx:xxx.git(push)谷歌搜索后我首先尝试了这个:$gitpushorigin:refs/heads/refs/heads/masterremote:warn

git - 如何在 git 上手动运行 hook post-receive?

我已经通过Git将一个网站推送到我的远程服务器但是出现了错误cannotrunpost-receive:Nosuchfileordirectory所以这些东西在服务器上,只是没有部署到我的/public文件夹。但是我确实有一个接收后文件,所以我不确定为什么找不到它。现在我认为我需要做的就是手动运行这个接收后Hook来进行checkout,尽管我不知道如何... 最佳答案 钩子(Hook)是一个可执行的shell脚本。如果您需要手动运行它,您可以从命令行执行它,尽管如果您的存储库有多个头(即您使用分支),构建预期的stdin输入会有些

git - 如何在 GitHub 上运行 post-receive hook

如何在GitHub中运行接收后Hook?。我知道有web-one但我想编写自定义脚本并且不想收到来自github的帖子。 最佳答案 post-receivehookofGithub实际上只是“WebHooks”,用于在存储库被推送到时与网络服务器通信。出于安全原因,您不能在GitHub服务器端运行任何东西。Whenapushismadetoyourrepository,we'llPOSTtoyourURLwithapayloadofJSON-encodeddataaboutthepushandthecommitsitcontaine

ruby - 混帐,Heroku : pre-receive hook declined

我正在设置一个git存储库并尝试将其链接到Heroku。当我运行命令时gitpushherokumaster我收到了Countingobjects:7,done.Deltacompressionusingupto2threads.Compressingobjects:100%(5/5),done.Writingobjects:100%(7/7),714bytes,done.Total7(delta1),reused0(delta0)----->Herokureceivingpush!Herokupushrejectedduetoanunrecognizederror.!We'vebee

Git-远程 : error: cannot run hooks/post-receive: No such file or directory

我得到错误:remote:error:cannotrunhooks/post-receive:Nosuchfileordirectory尝试推送到远程时。post-receivce文件存在于正确的位置(testnew.git/hooks)并包含:#!/bin/bash2exportGIT_DIR=/var/www/testnew/testnew/.git/exportGIT_WORK_TREE=/var/www/testnew/testnew/cd/var/www/testnew/testnew/echo"herewego..."gitfetchgitmergeorigin/maste