-
Notifications
You must be signed in to change notification settings - Fork 58
Home
To enable the Repository Mirror Plugin for a repository, navigate to the repository's Settings page and select Hooks: https://stash.yourdomain.com/projects/YOUR_PROJECT/repos/YOUR_REPO/settings/hooks
To configure the hook, click the Mirror Hook text (or the pencil icon).
- Enter the http(s) url of the remote repository. Do not include the user name. Ex. https://github.com/englishtown/stash-hook-mirror.git
- Enter the user name
- Enter the password (this will be stored encrypted)
- Click the Enable Button
- Enter the url of the remote repository. Ex. git@github.com:englishtown/stash-hook-mirror.git or file:///path/to/repo
- Click the Enable Button
- Under the user that BitBucket runs other, you may need to add the following to your ~/.ssh/config for github.com to disable host key verification. Another alternative is to perform a successful connection manually (via command-line) to github.com so that ~/.ssh/known_hosts is correctly populated prior to running the hook:
Host github.com
Hostname github.com
StrictHostKeyChecking no
CheckHostIP no
This is a solution to a CommandFailedException
due to Host key verification failed
.
To add additional remote mirrors, click the Add Mirror button. To remove a remote mirror, click the Remove button next to the mirror url you want removed.
Depending on the size of the repository, it can take a couple minutes for the initial mirroring to complete. If the commits do not appear on the remote check the following:
-
Ensure your stash server has a minimum of Git 1.7.10 installed. Check by running
git --version
. -
Double check the remote url and credentials are correct. You can try manually running the git command from the stash repository directory to confirm the url and credentials are correct. Here is an example with a https remote repository url:
git push --prune https://username:password@github.com/englishtown/stash-hook-mirror.git +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/*
If using ssh, ensure your private key is installed for the user stash runs under.
-
You may need to accept the ssh fingerprint of the remote server before you can begin mirroring.
-
Check the stash logs, errors and warnings should be logged by default. Search for com.englishtown in the logs ($STASH_HOME/logs/). For Bitbucket, check $STASH_HOME/log and atlassian-bitbucket.log or the timed versions of it.
-
Mirroring to a non-bare remote repository can be achieved following the instructions here.