How to delete a branch in git?

You can delete a git branch locally and remotely using git branch command.

Delete a local git branch:

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

The -D option is an alias for –delete –force, which deletes the branch irrespective of its merged status.

Delete a remote git branch:

Leave a Reply