Can I submit a pull request from GitLab.com to GitHub?

This is weird but this is how I do it!

I have a repository on Github but I wanted to use the Gitlab CI, so I mirrored the repository from Github to Gitlab, then I configured the CI etc... I was looking around online, and I found that with Gitlab Enterprise you have the feature of pushing changes to an external repository from GitLab, but since I don't pay for Gitlab Enterprise, I did the following:

Since we are using GIT, and we are good programmers try to be good programmers make it work, so:

I JUST EDITED THE GIT URL

How was it?

  • Clone your repository
  • Go to your project ...
  • Navigate to .git > config and you should have something like this:

    .git/config file

Change the URL from Github to Gitlab (I had the same username and project name, in both services so, I only changed the URL).

Then, with the Gitlab URL:

$ git pull origin

Since the remote URL have changed, you should get the changes from Gitlab.

  • Change again your remote URL back again to Github

Then push your changes:

$ git push origin

You should be done! Hope it works for you, it worked for me! 🧐


Nope, there's no way to do this with Microsoft GitHub.

Instead, you'll need to:

  1. Create a GitHub repository
  2. Add the GitHub remote:
    • SSH: git remote add gh [email protected]:org/repo.git
    • HTTPS: git remote add gh https://github.com/org/repogit
  3. git push gh master
  4. Create the pull request from your GitHub repository.

No. The correct workflow would be forking the upstream project on GitHub to your own namespace. Then use your fork as upstream in your GitLab repository not the origin of your fork.

From your GitLab repository you are then pushing changes to your fork (upstream). Then on GitHub you can submit a pull request from your GitHub fork to the origin.