Updating commits from the Master repo to Forked repo

Forked account A repo to B account and in A account repo is updated with some additional commits, B account repo need to update the new commits of A account repo. I am unable to find the options for the same.

Given repo is outdated and need to fetch the latest commits from the master repo but cant find the correct option to do that. Pls help.

So, you need to add repo A as a “remote” and pull from there.

For example:

$ git add upstream git@gitlab.com:GROUPA/PROJECTA.git

Then you can might want to check that that worked:

$ git remote -vv 
origin	git@gitlab.com:GROUPB/PROJECTB.git (fetch)
origin	git@gitlab.com:GROUPB/PROJECTB.git (push)
upstream	git@gitlab.com:GROUPA/PROJECTA.git (fetch)
upstream	git@gitlab.com:GROUPA/PROJECTA.git (push)
$

Then you can pull from the upstream branch as you normally would:

$ git pull upstream BRANCHNAME
...
1 Like

Hi,

I want to do this between two GitLab repo not from comand line.
In GitHub it’s called as Pull request where forked Repo’s lates changes can be compared and updated.

Regards,

Abhresh
8805587444 / 8788959494

Keep Learning! Keep Practicing!

Ah, right. In GitLab “pull requests” are called “merge requests”. There are some docs here that explain how to create an MR from a fork.

Good luck!

Hi,

I have gone through the given document but couldn’t find a solution to my question!
Here is the image explaining the concern (apologies for poor drawing):

It’s the same process as described in the documentation that I linked, the only difference is that you want an MR that goes from the Master repo, to the Forked repo, rather than the other way around.

Hi,

No,
Being in the Account 2(forked repo) i want to create a MR such that I can pull the new commits of Account 1 repo (Master repo). Such feature is there in GitHub where u can create a MR which will pull the commits of Master Repo to Forked repo. i was unable to do it in GitLab…

Regards,

Abhresh
8805587444 / 8788959494

Keep Learning! Keep Practicing!

Ah, ok, sorry. Either way though, the way to create a merge request between a project and a fork from that project is described here.

1 Like

Hi,

In this case of GitLab when I go to the MR section and create MR I cannot see the Master on the left side at all…

GitHub

GitLab view for the same situation.
Image 1 shows Source branch:- here to fetch the changes from Master Repo I need to be able to see that in this list. This part is not working for me.

Image 2: I am able to select the target branch as anything out of the list.

Regards,

Abhresh
8805587444 / 8788959494

Keep Learning! Keep Practicing!