开发者

git autodeploy script within post-receive hook on ubuntu

I have an autodeploy bash scr开发者_如何学编程ipt to get updated repo to /tmp in 'post-receive' hook on gitosis

#!/bin/bash

PWD=$PWD

REPO_NAME=${PWD##/*/}

cd /tmp

git clone git@atom-desktop:$REPO_NAME

But anytime when I push repository I got error like this:

Host key verification failed.

fatal: The remote end hung up unexpectedly error: hooks/post-receive exited with error code 128

How to cope with that ?


You can simply do:

git clone --local $REPO_NAME

As git also supports cloning from local directories: git-clone

For local respositories, also supported by git natively, the following syntaxes may be used:

/path/to/repo.git/

file:///path/to/repo.git/

These two syntaxes are mostly equivalent, except the former implies --local option.


Sounds like there is a key mismatch in the SSH connection from wherever /tmp is and atom-desktop. What happens if you try to SSH from the machine that /tmp is located at to atom-desktop?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜