Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github: Push changes from one repo to another

Tags:

git

github

We are working on project where the client uses github as their repository. The client created an id for me and asked me to fork the project and push all the changes in my fork and create a pull request for the changes to be pushed to the main branch. This works fine.

But I manage a team of developers and no one has access to the github repo but me. So I have to collate all the changes and push it in to the github fork all the time.

But within our company we do have a gitlab license and we can create our repositories to which all our developers will have to access to it.

So my question is how do I create a link between the gitlab repo to github repo? How do I push the changes from my gitlab to github repo?

like image 624
Sam Avatar asked Dec 07 '25 08:12

Sam


1 Answers

Add a new remote with the url of github-repo into your gitlab-repo then push the changes to github-repo.

Go into gitlab repo then add a new remote (say, github-repo) with the URL of github repo.

# go into your gitlab repo
$ git remote add github-repo <github-repo-url>

Push gitlab repo's master branch changes to github repo's master branch.

$ git checkout master                
$ git push github-repo master    # push gitlab-repo master branch changes to github-repo master branch
like image 195
Sajib Khan Avatar answered Dec 08 '25 22:12

Sajib Khan