Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Daniele Fusari
Daniele Fusari
40,669 Points

Deleting branch in Git -d or -D

In the video before you said use -D https://teamtreehouse.com/library/branches-behind-the-scenes In this video you said use -d https://teamtreehouse.com/library/merging-branches

Is there a difference when deleting a branch??

1 Answer

yk7
seal-mask
.a{fill-rule:evenodd;}techdegree
yk7
Full Stack JavaScript Techdegree Student 22,891 Points
$ git branch -d branch_name

Note: The -d option is an alias for --delete, which only deletes the branch if it has already been fully merged in its upstream branch.

$ git branch -D branch_name

But use -D, which is an alias for --delete --force, which deletes the branch "irrespective of its merged status."