Git Delete Branch How-To, for Both Local and Remote

Then go back to your repo main page on GitHub, click on the button with the main branch name, and you’ll see this suspended menu: Click on View all branches, like in the image above, and you’ll be taken to a page where you can see the list of all branches. Take a look at […]

Then go back to your repo main page on GitHub, click on the button with the main branch name, and you’ll see this suspended menu: Click on View all branches, like in the image above, and you’ll be taken to a page where you can see the list of all branches. Take a look at the diagram the depicts the moment after you’ve added the new commits to exp but haven’t yet merged them back to main: If you go now and get rid of the exp branch, your repo will look like this: As you can see, the commits are still there. Sure, Git’s powerful branching capabilities might feel fantastic, but using a that relies too much on branches——can get you into trouble.
Source: CloudBees