How to delete a remote branch without deleting the local on git?

Viewed 5621

Does git push origin :<branch> delete the local branch as well? I need to save my local changes but delete the remote branch, and I can't test out creating a new branch/pushing and deleting right now. If not, is there any other way to delete a remote branch but keep the local branch/changes in the branch?

1 Answers

No, it doesn't delete the local branch. Doing the command you stated does exactly what you want.

Related