Git: add dev branch

View the current branch: git branch -a   (a * before the branch indicates the current branch)
Create a new branch: git branch <branchname> 
Publish the dev branch: git push origin dev:dev
Switch branch: git checkout dev

Develop code on the dev branch and merge branches.
Daily code is written on the dev branch. After the test code has no problems, the dev branch and the master can be merged.

  1. git checkout master # Switch to the master branch before merging
  2. git merge dev # merge the code of the dev branch to the master branch
  3. git push # Submit the operation just now to the remote github repository
  4. git checkout dev # Switch back to the dev branch for the next development


Delete branch: git branch -D branchname

  1. git push orgin :dev # delete the remote dev branch
  2. git checkout master # switch to master branch
  3. git branch -d dev # delete the local dev branch

Guess you like

Origin blog.csdn.net/weixin_38676276/article/details/109203840