Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Delete a Git branch both locally and remotely

Official Synopsis
$ Git Push Origin --delete
$ git Branch -d

If there are unmerged changes which you are confident of deleting:
$ git branch -D

Delete Local Branch



To delete the local branch use:
$ git branch -d branch_name

Note: The - d alternative is a moniker for - erase, which just erases the branch in the event that it has just been completely converged in its upstream branch. You could likewise utilize - D, which is a false name for - erase - drive, which erases the branch "regardless of its blended status." [Source: man git-branch]

Delete Remote Branch 

As of Git v1.7.0, you can delete a remote branch using
$ git push origin --delete
which might be easier to remember than
$ git push origin :
which was added in Git v1.5.0 "to delete a remote branch or a tag."

In this way, the form of Git you have introduced will manage whether you have to utilize the less demanding or harder sentence structure.

Other links you may like 
HTTP Error 403, 404, 500, 503, and 504 | Create Database in SQL Server 2014| Create Multiple Instance in SQL Server 2012 | Create Table in SQL Server 2014|  DNS on Windows Server 2012| Failover Cluster - Windows Server 2012



This post first appeared on IT Support Servers And Desktop Solution, please read the originial post: here

Share the post

Delete a Git branch both locally and remotely

×

Subscribe to It Support Servers And Desktop Solution

Get updates delivered right to your inbox!

Thank you for your subscription

×