Subrata Sarkar Subrata Sarkar - 3 years ago 85
Git Question

How do I merge one commit of a branch to another branch - use case

I have a branch

access-permission
at my local as well as in github remote. I made changes to it, committed locally and pushed into
access-permission
remote branch.

Now I require to merge this commit into another remote branch called
staging
. I do not have a
staging
branch locally.

I may possibly clone remote
staging
branch to my local, checkout to it, merge
access-permission
into it and finally commit to remote
staging
branch. But is this the right way to go? Is there any way to do this without having
staging
branch locally?

I don't have enough experience using
git
so got confused. Please advise.

UPDATE:
enter image description here

Lix Lix
Answer Source

What you have described is the correct way to do this. You'll have to have a local copy of the staging branch in order to actually merge between the two branches.

It is also the place where you would handle any possible conflicts durring the merge.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download