Square-root Square-root - 1 year ago 222
Git Question

Merge local branch into remote branch other than master?

so I have a local branch A that doesn't exist yet in remote repo. And I have remote branch B in remote repo. How do I merge my local changes into the remote branch?

refer me to some links if you can.

Answer Source

If branch B is at local, You can merge A to B locally and push B to remote:

git checkout B
git merge A
git push origin B

If you don't have B at local, you can push A to remote and pull request to merge A to B and click merge button on github.

or, fetch B branch to local and merge A to B , then push B to remote, like this:

git checkout master
git fetch orign B:B       (fetch B to local)
git checkout B            (checkout to branch B)
git merge A               (merge A to B)
git push origin B         (push merged branch B to remote)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download