What is the difference between using -d and -D when deleting a branch in git?

Can any body help me understand what is the difference between the two git commands?

$ git branch -d testing

and

$ git branch -d testing

When should we use -D?

0
source share
2 answers

git branch -ddesigned to remove branches that are fully merged in their branch up or in HEAD if you do not have an upstream for your branch. If the branch is not fully merged, it will not perform the deletion.

git branch -d removes a branch, even if it is not merged.

+2
source

: -D -d --force. -D - , , , . -D , , , , -D.

, -D , -d --force, -d --force, Git 2.3.

+2

Source: https://habr.com/ru/post/1624990/


All Articles