How to delete a Git branch both locally and remotely?
X

Congrats, You are Subscribed to Receive Updates.

How to delete a Git branch both locally and remotely?


How to delete a Git branch both locally and remotely?. Here is very simple commands for you to delete the existing branch on local and remote server. Let’s start with local branches, Deletion command for Local system branch delete :

$ git branch -D branchname
Deleted branch branchname

Here gi branch -D is the syntax and followed by the branch name which you want to delete. That’s it. to delete locally, but for the remote server, we need to delete with the following command, many people stuck with the issue of remote deletion. ┬ásometimes it wont work properly. Don’t worry here is the command which will work surely.

git push origin --delete branchName

and,

git push origin : branchName

That’s it to delete the branches on remote server and local server. and one another approach is there, but it was older one, you can try this too.

git push --prune origin
commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

Comment Below

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts