How merge without Pull Request?

If I want merge master<-branch, both direction will be merged or master->branch if pull will not closed.

I do not know if I understand the question, but I try to answer…

For the question of the title you can merge branch without pull request in your local machine, like the help page says:

git merge --help

the output is:

[...]

Assume the following history exists and the current branch is "master":

                     A---B---C topic
                    /
               D---E---F---G

Then "git merge topic" will replay the changes made on the topic branch
since it diverged from master (i.e., E) until its current commit (C) on
top of master, and record the result in a new commit along with the names
of the two parent commits and a log message from the user describing the changes.

                     A---B---C topic
                    / \
               D---E---F---G---H master

[...]

Accordingly to merge the branch named “branch” into branch “master” you need to be in the branch “master” and than run the command:

git merge branch

now all the changes made on “branch” are merged into master, but the “branch” are still there and will continue to exists until you not delete it with:

git branch -D branch

If you want master merge in branch you can reverse the commands above:

  1.  move to “branch”:

    git checkout branch

  2. merge “master” in “branch”:

    git merge master

Done.

Hope to solve your problem :slightly_smiling_face:

-Gabriele-

4 Likes