我如何确定我只删除了 Git 中的本地分支?

How can I be certain I only delete my local branch in Git?

让我们假设我开发了一个很酷的功能并推送了分支 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”标志是否也会远程删除分支或本地删除分支?

命令git branch -D branch-name只会在本地删除分支

git branch -D <branch-name> 只删除本地分支。

要从远程删除一个分支,有一个不同的命令。

git push origin --delete <branch-name>

关注此 link。 https://www.git-tower.com/learn/git/faq/delete-remote-branch