常见的git分支管理命令
git拉取代码
拉取指定分支到本地:
git clone -b develop http://120.78.217.162:8695/Leepoo/sellersystem.git
不指定分支时:
git clone http://120.78.217.162:8695/Leepoo/sellersystem.git
分支管理–查看分支
查看本地分支
git branch
查看项目的所有分支(本地和远程)
git branch -a
分支管理–创建分支
先在本地创建loosue分支,然后切换到新建的分支
git branch loosue
git checkout loosue
或者可以 git checkout -b loosue
在新建分支上修改后提交到新建分支
git add .
git commit -m 创建loosue分支
git push origin loosue:loosue
切换到主分支并合并新建分支代码
git checkout master
git merge loosue
git pull origin master
git push origin master
分支管理–删除分支
删除本地分支
git branch -d loosue
删除远程分支
git push origin -delete loosue
或者git push origin :loosue