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分支可以被删除。

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

相关文章:

  • 2021-06-16
  • 2021-08-08
  • 2021-11-01
  • 2021-09-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-08-12
  • 2021-10-03
  • 2021-08-11
相关资源
相似解决方案