! [remote rejected] errors after mirroring a git repository

As mentioned in this issue, that happens when you mirror a GitHub repo which has pull requests made to it. The refs beginning ‘refs/pull‘ are synthetic read-only refs created by GitHub – you can’t update (and therefore ‘clean’) them, because they reflect branches that may well actually come from other repositories – ones that submitted … Read more

Mirror a git repository by pulling?

First create a mirror with git clone –mirror git@somewhere.com:repo.git then setup a cron job like this: */1 * * * * gitbackup cd /backup/repo.git && git fetch -q –tags This will backup the changesets every minute. Maybe you want to do this less frequently.

Mirroring from GitLab to GitHub

GitLab has now an option to do this from the UI, go to the Settings->Repository of your repo: https://gitlab.com/yourUserNameInGitLab/yourRepoName/settings/repository Then find the option “Mirror a repository” and click on expand. What you want to do is choose the “Push” mirror direction and fill this URL: https://yourUserNameInGitHub@github.com/yourUserNameInGitHub/yourRepoName.git In the password field, you have to use a … Read more