【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

原文地址:廖雪峯的官方網站網站

相關文章
相關標籤/搜索