我可以确定我只删除Git中的本地分支吗?

问题描述 投票:0回答:1

让我们假设我开发了一个很酷的功能并按下了分支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 git-branch
1个回答
0
投票

git branch -D仅删除本地分支。

要从远程删除分支,有不同的注释

git push origin --delete feature/login

跟随此链接。https://www.git-tower.com/learn/git/faq/delete-remote-branch


0
投票

命令git branch -D branch-name将仅在本地删除分支

© www.soinside.com 2019 - 2024. All rights reserved.