Is it possible to fork a GitHub project into a GitLab project and the other way around?
<Fork repository from Gilab to Github>Create an empty repository on Github with the same name as the Gitlab repository. Register Github (origin) and Gitlab (upstream) since you cloned the Gitlab repository, its origin is set to the Gitlab repository. This needs to be changed to Github.
You can fork a project in GitLab by going to the project and clicking on the Fork button. This will create a copy of the project in your own namespace. You're allowed to do whatever you want with this copy as it's is your own.
GitLab CI/CD can be used with GitHub.com and GitHub Enterprise by creating a CI/CD project to connect your GitHub repository to GitLab.
A fork is a copy of an original repository that you can put somewhere else or where you can experiment and apply changes that you can later decide if publishing or not, without affecting your original project. It takes just a few steps to fork a project in GitLab. Sign in to GitLab.
When creating a new repository, you can choose to import another repository, and one of the options is to import it via its https://...
url from another repository site, such as github. This starts a git clone --bare <url>
to import the repository. In the GitLab documentation the process is described in detail. Whenever I tried that, the process kept refreshing to the same "in progress" state indefinetly.
Update: This seems to work only for repositories you own. So to import a public repository, a workaround would be to fork it and import the fork.
So another way would be to clone the repository on the commandline before populating your new repository:
When you create a new, empty repository at your gitlab site, you get a page full of suggestions how to proceed to populate this repository.
Setting up a tracker for a github site is basically a variant of the
Existing Git repository recipe with the minor difference of cloning the repository to track first, and instead of renaming the previous origin
to old-origin
as suggested in the recipe, you want to rename it to upstream
instead to maintain conventions. So you'll end up with proceedings as outlined:
git clone https://github.com/<author>/<repository.git> <repository>-tracker
cd <repository>-tracker
origin
) to something else (upstream
), so you can still address it.
git remote rename origin upstream
origin
. The exact line to use including the path to your own repository can be found in the Existing Git repository recipe you probably received as a result of the previous step.
git remote add origin git@<gitlab-server>/<path-to-your-repo>.git
git push -u origin --all
git push -u origin --tags
git remote -v
origin git@<gitlab-server>/<path-to-your-repo>.git (fetch)
origin git@<gitlab-server>/<path-to-your-repo>.git (push)
upstream https://github.com/<author>/<repository.git> (fetch)
upstream https://github.com/<author>/<repository.git> (push)
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