GIT学习----第十五节:Feature分支

学习目的

  1. 如何对未进行合并的分支进行强制删除?

强制删除未合并分支

  1. 建立并切换新功能分支feature-001
$ git checkout -b feature-001
Switched to a new branch 'feature-001'
M       readme.txt
  1. 查看工作区
$ git status
On branch feature-001
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   readme.txt

no changes added to commit (use "git add" and/or "git commit -a")
  1. 提交
$ git add readme.txt

$ git commit -m "测试新功能分支"
[feature-001 6edb4e3] 测试新功能分支
 1 file changed, 2 insertions(+), 3 deletions(-)
  1. 切换回master分支
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 13 commits.
  (use "git push" to publish your local commits)
  1. 突然该功能不要了,并且需要删除该功能分支
$ git branch -d feature-001
error: The branch 'feature-001' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feature-001'.
  1. 有提示可看出
$ git branch -D feature-001
Deleted branch feature-001 (was b1f9f41).

总结

  1. 新功能和bug修复一样,都需要进行创建新的分支进行处理;
  2. 当没有合并分支要删除分支的时候采用强制删除分支:git branch -D

其他

QQ交流群: 264303060

QQ交流群

我的博客,欢迎交流!

我的优快云博客,欢迎交流!

微信小程序专栏

前端笔记专栏

微信小程序实现部分高德地图功能的DEMO下载

微信小程序实现MUI的部分效果的DEMO下载

微信小程序实现MUI的GIT项目地址

微信小程序实例列表

前端笔记列表

游戏列表

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rattenking

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值