Best Way To Merge A Git Branch Into Master
Question:
There are two branches,
master
anddevelop
.
What is the best and safest way mergedevelop
branch intomaster
branch?
Answer:
Here is the solution. After you commit everything in develop
branch.
Do as following steps:1
2
3
4git checkout master
git pull origin master
git merge develop
git push origin master
As other answers mentioned, this solution is only acceptable for a small project, like only few branches, and other people won’t make changes in master
branch. From my personal perspective, if there are some conflicts between master
and develop
branch, this might not be a good way to solve this problem.
Reference
Best (and safest) way to merge a git branch into master
This is the end of post