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

Martins Gouveia @martygo

About: Software Developer @Directv

Location:
Luanda, Angola
Joined:
Sep 28, 2020

How to delete multiple git branches locally and remotely?

Publish Date: Nov 11 '23
1 0

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.

Comments 0 total

    Add comment