Simple and easy to understand git merge branches

Simple and easy to understand git merge branches

Suppose we are on the test branch and have just completed a function and executed the following command:

git  add .
git  commit -m 'test分支提交的备注信息'
git  push  origin dev

After testing, the newly developed functions on the test branch are no longer problematic. If you want to merge the test branch into the master branch, the operation is as follows:

  1. First switch to the master branch
git  checkout master
  1. If it is developed by multiple people, you need to pull the code on the remote master
git pull origin master
  1. Then we merge the code of the test branch to master
git  merge dev
  1. Then check the status and execute the submit command
git status

On branch master
Your branch is ahead of 'origin/master' by 12 commits.
  (use "git push" to publish your local commits)
nothing to commit, working tree clean

The above means that you have 12 commits and need to be pushed to the remote master

  1. Finally execute the following submit command
git push origin master

Guess you like

Origin blog.csdn.net/weixin_47160442/article/details/112860553