常见的git分支管理命令

常见的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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值