![]() Sometimes it might be possible that due to some incomplete merge or due to any exception above -d option won't able to delete the branch. This confirms successful deletion of feature branch. Now if we again check the list of branches, then we see feature branch is not there. ~]# git branch -d feature Deleted branch feature (was 99268c5). So we will go ahead and delete feature branch by using git branch -d feature command. As you can see from below output currently we have two local branch( dev and feature) and one remote branch( origin/dev). But before that let's check the list of local branches we have in our repository. In normal cases, when you don't have any error or exception in local branch, then you can delete your branch by using git branch -d command. More on GitHub docs.Īlso Read: How to Configure Git Username and Email Address in 2 Simple Steps Method 1: How to Delete a Local Branch in Git So to delete a branch in git, you need to follow below given methods. Only dev and master is the permanent branch which should be kept stable at all the times. But the bottom point is that once deployment is completed then a developer might delete his local and remote branches as it was a temporary branch required till deployment. It may change project to project and company to company depending on the use case. This is a very general branching strategy followed by a developer. Then after successful QA deployment, dev branch gets merged with master branch for production deployment. After review approval this code will be pushed to some development branch like dev for QA deployment. Every developer working on a project usually keep all their code in the local branch and once it is ready for review then he/she creates a pull request to review his/her code. ![]() If you don't then let me explain you in a very brief. If you are working on Git Repository then you might be aware of branching strategy and concepts. In this article, we will see how to delete a Branch in Git using 2 easy methods.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |