I have several developers working on a local Gitlab instance. The client requires that their Github repo is kept updated. So our Gitlab repo should push any commits directly to Github. Any commits to Github should likewise be pulled into Gitlab.
I could do the first part (dev --> gitlab --> github) with jenkins or something, but am stuck on the reverse. Our Gitlab and Jenkins run inside our firewall.
Any hints or pointers (or drop in solutions!) would be very appreciated.
You simply need to add new remote and the push your code, That's it. Following the second option: fatal: remote origin already exists. Also, what about pushing using the git CLI? Git commands for gitlab and github are shared, so doing git add will stage for both.
Yes, you can use the Windows GitHub client and the GitHub Desktop client with GitLab, BitBucket or any other hosted Git solution. We only use it with HTTPS and you'll need a valid certificate if you do use HTTPS. It may work with HTTP as well.
For self-hosted private repositories, GitLab is the better choice. You can get started without having to pay any monthly subscription fee. Both options are great for open source projects, with GitLab offering premium features for free and GitHub offering access to a larger pool of active open source developers.
It's only in the enterprise edition and on GitLab.com, but GitLab has introduced this feature directly, without any workarounds.
They've documented pulling/pushing from/to a remote repository in GitLab Docs → User Docs → Projects → Repositories → Mirroring.
It's in the same section of configuration that you can push, too:
https://yourgithubusername:[email protected]/agaric/guts_discuss_resource.git
Note that I haven't tried it, but you should be able to push to and pull from the same repository. It's working great for me pulling from a remote repository (drupal.org), and pushing to a different remote repository (gitlab.com).
For syncing from GitHub to GitLab you could use the Webhooks to send a notification to your site and possibly manage this somehow (although I don't know if GitLab supports this out of the box).
And with a bit more implementation you could (theoretically) use the GitHub API.
I also found a small script named "simple (and dirty) sync between redmine issues and gitlab issues" which should do at least this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With