让我们假设我开发了一个很酷的功能并按下了分支my-cool-feature
。我确定一切正常,并且在本地也不再需要它,因为分支将合并到master
。
使用git branch -d my-cool-feature
会抛出一些错误消息If you are sure you want to delete it, run 'git branch -D my-cool-feature'
。
使用“ -D”标志是否也会远程删除分支或本地only?
git branch -D仅删除本地分支。
要从远程删除分支,有不同的注释
git push origin --delete feature/login
跟随此链接。https://www.git-tower.com/learn/git/faq/delete-remote-branch
命令git branch -D branch-name
将仅在本地删除分支