7

I'm having trouble updating a GitLab repo from a Github repo. An update was released for the Github repo that I've forked, and I would like to incorporate that update into my fork. Does anyone have any way to do this other than replacing the project files manually?

4
  • git remote add other-github GITHUB_URL; git pull other-github master ? Commented Mar 28, 2016 at 21:27
  • @JavaNut13 Will this work for git repositories other than Github? Or does it not matter? For example: git remote add http://git.site.org/mathewwe/ftc_app.git; git pull https://github.com/ftctechnh/ftc_app.git beta. Is this what you mean? Commented Mar 28, 2016 at 21:35
  • It will work with any git repo. You do need to give a name to the remote that you're adding (in my example it is other-github) which identifies the repo and URL to pull from. Commented Mar 29, 2016 at 4:36
  • If you need your GitLab repo to be updated whenever there's a change in GitHub, perhaps the best way to do that is using GitLab import and set it up to mirror the GH repo. But I'm not sure it's what you need here. You could also use git fetch if can't import for some reason. Commented Mar 29, 2016 at 15:12

1 Answer 1

8

Gitlab allows automatic mirroring but it appears to be a paid feature.

Navigate to your project’s Settings > Repository and expand the Mirroring repositories section (only seen if you have a paid for version).

  • Enter a repository URL.

  • Select Pull from the Mirror direction dropdown.

  • Select an authentication method from the Authentication method dropdown, if necessary.

  • If necessary, check the following boxes:

    • Overwrite diverged branches.

    • Trigger pipelines for mirror updates.

    • Only mirror protected branches.

  • Click the Mirror repository button to save the configuration.

Sign up to request clarification or add additional context in comments.

1 Comment

oooh wow, one missing tiny operation to try to force the user into using their repo or paying... pathetic but at least I find out early not to use them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.