Tips to delete, remote and local branch from GIT e.g github, bucket
Deleting a remote as well as a local branch from git is pretty simple.
To delete a remote branch -:
Step 1: Just go into your project directory from console/gitbash(if you are using windows)
In console enter-:
$ git branch -r
You see a list of the remote branches .
- origin/design
- origin/develop
- origin/feature
- origin/master
Step 2: If you want to delete the branch name develop
from git(Github)
Then enter in the console-:
$ git push origin :develop
(Where origin
is your remote name and develop
is the name of the branch)
The above command will delete the develop branch on the origin remote
To delete a local branch -:
Step 1: First, make sure you are not on the same branch
(eg. develop
) which you are going to delete from the local repo also. Just move from that branch to another branch using.
$ git checkout branch_name
Step 2: Then enter in the console:
$ git branch -d develop
This will delete the branch locally as well.
………Well Done………
blog comments powered by Disqus
Vivek Parihar
About Me, Elsewhere
A Weboniser and Rubyist. Work on open source web development technologies (Ruby and their frameworks like Rails and Sinatra , PHP and its framework CAKE) and mobile technologies like Android. Deep passion for elegant design,cloud infrastructure(Rackspace and Amazon Web Services, AWS, S3, EC2) and their automation, distributed applications development, systems scaling, agile development methodologies, and experimental technologies. Frequent speaker at conferences. Like to hack on d3.js(data visulaization). Hobby boxing, cricket and tracking.