Integrate Github commits to gitlab repository - github

Is this a possibility to integrate github repository in gitlab.
My basic need is to commit in github and flow it all in gitlab.
I am not sure if this can be done!
Is this a classical case of CI?
Thanks!

I think you want to do some mirroring of your project. I guess (but not tested) that if the repository have a .gitlab-ci.yml file, pipelines will be launched when commits are mirrored.

Related

Github mirror repository using workflow from another repo

My problem is I have mirror repository on GitHub, that I can't commit into. I have to run some pipelines on this repo. In GitLab CI, it's possible to select CI/CD configuration file from another repo. I searched throught actions repo settings, but I couldn't find anything that would help me. Is that possible in GitHub Actions? Or I have to find some workaround?

Connect Github project with Gitlab

Is there a way to connect a GitLab project with Github? I mean when I push or make any modification to the Gitlab project it should be done automatically to another same copy in Github.
Is there a way to do that?
Yes there is. Gitlab offers Repository mirroring out of the box for all tiers:
Repository mirroring allows for the mirroring of repositories to and from external sources. You can use it to mirror branches, tags, and commits between repositories. It helps you use a repository outside of GitLab.
A repository mirror at GitLab updates automatically. You can also manually trigger an update at most once every five minutes on GitLab.com with the limit set by the administrator on self-managed instances.
There are two kinds of repository mirroring supported by GitLab:
Push: for mirroring a GitLab repository to another location.
Pull: for mirroring a repository from another location to GitLab.
I use this to synchronize my repos between Github and Gitlab and works fine for me

Forking Github into AzureDevops

I'm wanting to fork a github repo into AzureDevOps, whilst retaining the capability within AzureDevOps to keep pulling changes from github as-per forking a repo within github.
Is this feasible / on a roadmap?
I'm wanting to fork a github repo into AzureDevOps, whilst retaining the capability within AzureDevOps to keep pulling changes from github as-per forking a repo within github.
I am afraid there is no such out of box function of the "Fork" in GitHub for Azure Devops. But you can import repository from GitHub directly.
In Azure DevOps the project you want to clone the repository or create a new team project, click code tab. Click repository menu in Code Tab (it is on the top left side) and select Import repository:
Then, slect the SourceType GIT and add your github repository URL:
However, according to the ticket on the github:
Currently there is no Azure DevOps' build in support for automatically
updating your GitHub repo fork in Azure Repos.
We need do the sync manually on the dev machine.
Besides, there is an old document about How-To Fork Git Repositories on Visual Studio Online, but we still need to create a middleman to moderate changes from GitHub before pushing them into a VSTS project.
Hope this helps.

Github for Windows Pull Request for remote Bitbucket Repo

Based on this tutorial I was able to successfully connect Github for Desktop with my remote Bitbucket repo.
Looking at the example tutorial repo I see there is an Pull Request option built in the application - great:
However the option is missing when I chose my remote Bitbucket repo:
I couldn't find any option that is reponsible for this.
Anyone knows what affects this behavior?
"Pull Request" is very much a GitHub feature, associated to GitHub repos.
So For BitBucket, the simplest approach is to push your feature branch to the remote repo (which is a BitBucket one, not a GitHub one), and make your PR from there (from the remote BitBucket web GUI, even within the same repo)
Once the PR is initiated, each push done from the GitHub Desktop will complete said PR.
In Bitbucket go to Settings -> Branch Permissions, and add a new branch permission with your name.
EDIT
https://stackoverflow.com/a/37343356/1544886

From github to bitbucket

Imagine situation like this:
You have a working repo in bitbucket - you were pulling revisions from another bitbucket repo in Windows 7 through TortioseHG.
Now the second project has moved to Github system and you can not pull from it anymore.
So my question is like this:
How can i somehow create new repo in bitbucket where I will pulling changes from github and from this repo i can easily pull in Tortiose HG to my working repo?
I do not want to use Github etc, so please do not advice it to me etc just help me with my question. Thank you.
The ideal solution consiste to keep local Mercurial repo, and work only with this local repo to the existing bitbucket Mercurial remote repo.
With a plugin like Hg-Git, you can at least push to and pull from a Git server repository from Mercurial, allowing you to pull from the GitHub repo to your local Mercurial repo.
From that local (Mercurial) repo, you can then work as usual with the bitbucket remote repo.
The OP adds:
It didn't work for me so i tried to transfer git repo to hg repo and from this repo pull to my working repo with changes - but it says that: abort: repository is unrelated - but I merged a lot from it. Any help here?
That makes senses, if both repos have been developed separately, you cannot push/pull 2 (mercurial) repos one into another.
This is confirmed at the bottom of the page "Understanding Mercurial", and detailed in the blog post: "What Mercurial Can't Do: Subtree Repos".
The more practical solution would be to make one extra repository (a "parent one") with your two repos declared in it as nested repository.
It would keep both repos independent, allowing to push back to the GitHub repo from your second mercurial repo.
If you don't have to push back to GitHub, but really want to have one repo in which you merge common files, then you can look in "Merge tip from an unrelated repository with Mercurial", but that is much more complex.
I would rather:
keep both repos separate
delete from the first one the common files you need to merge in the second one.
report and merge those common files in the second one.