How to merge the two applications that are in a separate Gitlab?

Asked

Viewed 325 times

0

I took a job where the staff has two versions.

I’ll explain better:

  1. One company A transferred a client to another company B, both of IT.
  2. Company A passed a version and the backlogs to company B.
  3. Company A made new implementations and Company B also.

I need to merge the two applications that are in a separate Gitlab: company A and company B, both with their modifications. And make "final" version to actually have company B updated version of both.

What’s the best way to do that? I’m a little lost in the process. I wanted to do it the right way, no tests because it’s the first time I’ve done it.

  • Well, one had committed and another came to the company and the previous developer didn’t commit to his version, so I was wrong about using Git. But the idea would be the same posted by @Fernando Silveira. What I used here was Meld (https://meldmerge.org/). It took work, but as it is modularized and by components was correct. Thank you staff.

1 answer

1


If I understand correctly, all you want to do is merge between two different branches of two different repositories. For this case we will call the branches "branch-a" and "branch-b", and the repositories "re-frame-a" and "re-frame-b".

  1. First create a local repository and download enterprise repositories A and B:
$ git init repo
$ cd repo
$ git remote add repo-a https://gitlab.com/empresa-a/app
$ git remote add repo-b https://gitlab.com/empresa-b/app
$ git fetch repo-a
$ git fetch repo-b
  1. The two repositories and branches have been downloaded and now you need to create a local branch from one of the two. In this case I chose "branch-a":
$ git checkout -b branch-local repo-a/branch-a
  1. Then just merge the "branch-b" branch to the location:
$ git merge repo-b/branch-b
  1. If there are conflicts, resolve them and commit(s));
  2. Push to your repository:
$ git remote add origin https://gitlab.com/sua-empresa/app
$ git push -u origin branch-local

Although in this example I considered the possibility of branches being different, it may be that in your case the branches have the same name (master?) and even then the instructions above would work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.