In a local gitlab I created a copy of project nova (https://github.com/openstack/nova).
How do I keep the local nova repo in sync with github, updating maybe once per hour or per day?
I would like a solution similar to what is described here for bitnami: http://wiki.bitnami.com/Applications/BitNami_GitLab#Keeping_in_sync_with_the_GitLab_repository_at_GitHub
(I used Devstack to install Openstack.)
GitLab now has this feature built-in!
Since GitLab EE 8.2 it's supported. Hooray!
>
If you never need local commits, the following recipe will work:
Clone the repo with
--mirror
:Then in a cronjob, you do this for an hourly update:
The
--mirror
sets up the refspecs in such a way that subsequent fetches will update all local refs, so you don't need to merge the changes in. Of course that does mean that commits pushed to that repo are lost.I wrote a project with the intention of adding remote mirrors to GitLab. You can check it out here...
https://github.com/sag47/gitlab-mirrors
Create a cron job to update the repo
You can do this using cron jobs.
In your terminal type
crontab -e
(to edit your crontab) and add a new line at the bottom with the following.It will run a clone every day at midnight.