How to Delete a Branch form GitHub Repository?
In this tutorial we will go over the demonstration of how to delete a branch using git command. This article goes in detailed on git remove branch from local. This article will give you simple example of git remove branch from remote. This article goes in detailed on git remove branch from local only.
In this tutorial, we will use git branch command delete branch locally and remote in github repository. we will use git command to delete branch name into github. so let's follow below step to remove branch in git.
Clone Git Repository(Optional):
If you are new and you haven't create or clone github repository yet then you can follow bellow tutorial:
Github Create or Clone Git Repository.
Delete Branch using Git Command:
I will give you two commands to delete git branch from local and remote. let's see one by one command:
Delete Git Branch from Local:
Delete git branch from local means the branch will only remove on your local machine not on github repository. so it will stay on github repository.
Example:
git branch -d dev-change
You can see below layout:
Delete Git Branch from Remote:
Delete git branch from remote means the branch will only remove on github repository. so it will remove branch from github repository.
Example:
git push --delete origin dev-change
You can see below layout:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Switch Branch using Git Command?
- How to Create a New Branch on GitHub?
- How to Clone Github Repository using Command Line?
- How to Ignore Wildcard Files Name in Git using Gitignore?
- How to Ignore Folder in Git using Gitignore?
- How to Ignore File in Git using Gitignore?
- How to Git Ignore Some Files Locally?
- How to Clone a Git Repository into a Specific Folder?
- How to Clone Laravel Project from Github on Server?
- How to Generate and Add SSH Key in Gitlab?
- How to Add Git Add Remote Origin on Bitbucket Repository?
- Git - How to Find a Deleted File in Commit History?