DEV Community

Cover image for How to delete multiple git branches locally and remotely?
Martins Gouveia
Martins Gouveia

Posted on

1

How to delete multiple git branches locally and remotely?

To delete multiple Git branches locally, you can use the following command in the terminal:

git branch -d branch1 branch2 branch3
Enter fullscreen mode Exit fullscreen mode

This will delete the locally specified branches. If any branches have not been merged, you will need to use -D instead of -d to force the deletion.

To delete the same branches remotely, you can use:

git push origin --delete branch1 branch2 branch3
Enter fullscreen mode Exit fullscreen mode

Make sure to replace "branch1", "branch2" and "branch3" with the actual names of your branches. This removes branches both locally and in the remote repository.

Top comments (0)

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more