【git】当前分支不能被删除

1 Evan@Evan-PC MINGW64 /f/gitskills (master) 2 $ git checkout -b feature1 #create a branch 'feature1' and switch to it 3 Switched to a new branch 'feature1'
Evan@Evan-PC MINGW64 /f/gitskills (feature1) $ git branch -d feature1 #delete this branch 'feature1' error: Cannot delete branch 'feature1' checked out at 'F:/gitskills'
Evan@Evan-PC MINGW64 /f/gitskills (feature1) $ git checkout master #switch to branch 'master' Switched to branch 'master'
Evan@Evan-PC MINGW64 /f/gitskills (master) $ git branch -d feature1 Deleted branch feature1 (was b09fe14).

在切换到其余分支上以后,则feature1分支能够被删除。git

原文地址:廖雪峰的官方网站网站

相关文章
相关标签/搜索