How to delete branch in github

Deleting a branch LOCALLY

git checkout main

Delete a branch with git branch -d <branch>.

For example: git branch -d fix/authentication

The -d option will delete the branch only if it has already been pushed and merged with the remote branch. Use -D instead if you want to force the branch to be deleted, even if it hasn't been pushed or merged yet.

The branch is now deleted locally.

Deleting a branch REMOTELY

Here’s the command to delete a branch remotely: git push <remote> --delete <branch>.

For example: git push origin --delete fix/authentication

The branch is now deleted remotely.




Learning each day without giving up.

Love podcasts or audiobooks? Learn on the go with our new app.

E.C. Jamming and More About Hackathons

Optimizing the mongo query


Where is visual scripting?

Create a Public API with gRPC

Scisprint February in Hsinchu

CS50x Readability

Chainlink GraphQL Middleware

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohammad Farman Abbasi

Mohammad Farman Abbasi

Learning each day without giving up.

More from Medium

How Hashing is useful in recent technologies?

Solve or Deny.

What Is Contract Management Software?

DeveloPassion’s Newsletter — Midweek Links #2