merge forked repo with testing branch of original repo

Viewed 117

How can we merge forked repo with original repo devops branch

below is given the original repo branches

Original repo
   master branch
   development branch
   devops branch
   testing branch

And this is the forked repo branch. it has 3 branch

forked repo
   master branch
   development branch
   modify branch
   

I want to merge master branch of fork repo in testing branch of original repo. After this merge again I want to merge testing branch with master branch of original repo.

1 Answers

I want to merge master branch of fork repo in testing branch of original repo

Don't want that. Reserve the master branch for merging things into it. You should not be merging master into something else except as part of coordinating two long-lived branches, e.g. master and development.

Instead, make a new branch, e.g. contributeToTesting. Put a commit on it so that it has an independent existence if necessary. Now, using the GitHub web interface, submit a pull request to the upstream (the original) asking to merge your contributeToTesting into their testing. When they approve the pull request, that is the merge.

After this merge again I want to merge testing branch with master branch of original repo.

So you want to merge testing into master, both of them back at the upstream (original) repo? You can only do that if you own the upstream repo. To do so, open the upstream repo in the GitHub web interface and submit a pull request to merge testing into master.

Note that my answers have assumed you want to do pull requests. If you don't, then you can do all this on your own local clone. Clone the fork to your local, and give it two remotes: origin (the fork at GitHub) and upstream (the original repo at GitHub). Now, if you own both GitHub repos, you are free to merge anything into anything, pull anything, push anything, whatever. Just specify clearly, when you give a command, which remote's branch you are talking about.

Related