I synchronize commits from one GitLab installation with my GitLab
installation every 12 hours.
I did that by making a new user on my server that doesn't need any password
so you can't log in it and I did *su - accountname *to gain the privileges
from the account I have just created and it goes automatically to the Home
directory.
I then generated an SSH Keypair using *ssh-keygen -b 4096* and copied the
public key.

I have then created a separate account on both GitLab instances and added
the SSH key to both profiles.

I have added the destination server as a remote:
*git remote add destination https://example.com/user/repo.git
<https://example.com/user/repo.git>*

Afterwards I've cloned the repository I want to sync from and moved all of
the repository's contents into ~/ and edited the crontab.
0 */12 * * * git fetch origin && git pull origin master:master && git push
-v --tags destination master >/dev/null 2>&1
This way it syncs one way every 12 hours.

2015-06-10 16:17 GMT+02:00 Friedemann Stoffregen <
stoffre...@mankind-software.de>:

> Maybe you should have a look on gitlab CI. I think you can archive
> something like that with it.
>
> Regards,
> Friedemann Stoffregen
>
> Am 10.06.2015 um 13:53 schrieb Matthias Döring <cryptolu...@gmail.com>:
>
> That is what I want. I want that gitlab make by herself pushes and pulls
> with github. When you have imported the repo with oauth. The advantage
> from this manner is you have no need to login into github. Have this
> effort somebody with me?
>
>
> Am Mittwoch, 10. Juni 2015 13:35:48 UTC+2 schrieb tombert:
>>
>> In GIT you can add as many remotes as you like and sync between them. But
>> this is no task of GitLab, this has to be configured in your local
>> repository:
>> https://help.github.com/categories/managing-remotes/
>>
>>
>>
>> On Wednesday, 10 June 2015 08:21:55 UTC+2, Matthias Döring wrote:
>>>
>>> Hi, I can create a new repository in gitlab or I can import any
>>> repository from github, google code and so on. When I have finished this
>>> steps the repos are cloned to my own gitlab. Now I working on my gitlab
>>> instance and make a lot of commits. Now I want that my commits from gitlab
>>> are applied to the original repos from github. Other github member see my
>>> changes. How should I configure my gitlab instance that it trigger pushes
>>> and pulls regular?
>>>
>>> *Important: I does not mean to migrate my github repos.* I want to use
>>> my own gitlab instance as my single-point application for both services (my
>>> own gitlab and old github repos that are not closed atm)
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "GitLab" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gitlabhq+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gitlabhq/034393ec-de5d-491c-a71a-366371be4fe5%40googlegroups.com
> <https://groups.google.com/d/msgid/gitlabhq/034393ec-de5d-491c-a71a-366371be4fe5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "GitLab" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gitlabhq+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gitlabhq/1478ACF2-CACB-450F-88EE-95F45565ACA8%40mankind-software.de
> <https://groups.google.com/d/msgid/gitlabhq/1478ACF2-CACB-450F-88EE-95F45565ACA8%40mankind-software.de?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/CALXQeks41SrVOcucC9Cqnzu9JJLcKo9oBHiotJGnahngfcE%2BTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to