尚硅谷面试第一季-13git分支相关命令

课堂重点:分支相关命令

实际应用-工作流程

实操命令及运行结果:

创建master分支并提交

git init

git add .

git commit -m "V1.0"

git remote add origin https://gitee.com/ZhangShunHai/gitbranch.git

git pull origin master --allow-unrelated-histories

git push -u origin master
			

创建feature分支并提交

git checkout -b feature

git add .

git commit -m "个人分支开发"

git pull origin feature

git push origin feature
			

此时feature分支没有与master分支合并,所以

合并feature和master分支

git checkout master

git merge feature

git add .

git commit -m "master 分支合并feature分支"

git pull origin master

git push origin master
			

删除feature分支

git checkout master

git branch -D feature
			

 文件下载:

https://gitee.com/ZhangShunHai/interview_atguigu_seasonone/tree/master/git%E5%88%86%E6%94%AF%E7%9B%B8%E5%85%B3%E5%91%BD%E4%BB%A4

转载于:https://www.cnblogs.com/zsh-blogs/p/10622753.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值