git merge repository

git merge repository

    1. View all branches
//本地
git branch 
//远程
git branch -r
//查看所有分支 
git branch -a
  • 2. If yes, switch the branch if not, create a branch and switch
//有分支
git checkout 分支名称
//无分支,创建加切换
git  checkout -b 分支名称
  • 3. Push the new branch to github
git push origin  分支名称
  • Add local code
git add .
git commit -m 'v1'
git push origin 分支名称
  • Switch to the main branch
git checkout master
  • Pull the warehouse, if the requirements are relatively high, use fork to copy a code to do some real-time operations
  • Fetch+merge has the same effect as pull. But use fetch+merge more, so that you can check whether the update from fetch is appropriate. Pull directly includes these two steps. If you think there is no problem with the online update, you can also directly pull.
git pull origin master
  • Merge branch
git merge dev
  • Upload code to remote
git push origin master

Guess you like

Origin blog.csdn.net/myhuangchao/article/details/109044086