$ git checkout -b feature-vulcan Switched to a new branch 'feature-vulcan'
5分钟后,开发完毕:
$ git add vulcan.py $ git status # On branch feature-vulcan # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: vulcan.py # $ git commit -m "add feature vulcan" [feature-vulcan 756d4af] add feature vulcan 1 file changed, 2 insertions(+) create mode 100644 vulcan.py
切回dev,准备合并:
$ git checkout dev
一切顺利的话,feature分支和bug分支是类似的,合并,然后删除。
但是,
就在此时,接到上级命令,因经费不足,新功能必须取消!
虽然白干了,但是这个分支还是必须就地销毁:
$ git branch -d feature-vulcan error: The branch 'feature-vulcan' is not fully merged. If you are sure you want to delete it, run 'git branch -D feature-vulcan'.