Reputation: 3
I've been googling for hours, trying to find the way.
I got a repo on gitlab, wish to merge one from github into a branch of mine at my gitlab repo. A way of comitting a merge, or likewise
example:
Merge branch 'Sarah' of https://github.com/repo/server into myServer
where myserver is my branch, sarah is the links branch and the link is a repo
Thank you in advance. PS. I'm noob in this subject, be userfriendly!
Upvotes: 0
Views: 62
Reputation: 40861
Add a remote to your Git Lab repo.
git remote add gitlab https://gitlab.com/user/repo.git
git fetch gitlab
Add a remote to Git Hub
git remote add github https://github.com/user/repo.git
git fetch github
Checkout a new temp
branch to merge based on myServer
git checkout -b temp gitlab/myServer
Merge Sarah
and resolve conflicts, etc.
git merge github/Sarah
Now you're free to do whatever you'd like with your temp
branch. Like push it to Git Lab.
git push gitlab temp
Or if you love it, then you could "overwrite" your myServer
branch by forcing the branch name to point to this commit.
git branch -f myServer
And then push that to Git Lab (you may need to force depending on context)
git push gitlab myServer
Upvotes: 3