1

I have installed a hook on the staging servers, allowing me to push to staging very easy. However, the code includes a submodule and this one does not get copied over due to access rights.

This is the post-receive hook I am using:

#!/bin/sh GIT_WORK_TREE=/home/www/staging git checkout -f pwd cd /home/www/staging/ git --git-dir=/home/git/staging.git --work-tree=/home/www/staging submodule update --init --recursive 

After trying to git push staging I get the following:

remote: /home/git/staging.git remote: Cloning into 'MEW'... remote: Host key verification failed. remote: fatal: Could not read from remote repository. remote: remote: Please make sure you have the correct access rights remote: and the repository exists. remote: Clone of '[email protected]:demo/demo-mew.git' into submodule path 'MEW' failed 

Do I need to create a cert on the staging server and add this one to bitbucket?

2

1 Answer 1

0

In the post-receive hook

#!/bin/sh GIT_WORK_TREE=/home/www/staging git checkout -f pwd 

Change dir to the root folder

Specify the work tree and directory

submodule update init

cd /home/www/ git --git-dir=<path to git dir>.git --work-tree=<path to submodule> submodule update --init --recursive 

I hope this will help Please let me know if this does't work Thanks

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your help. I updated the question coresponding to the problem. Is the displayed config as you recommend it to be? I am running into access right problems with this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.