git to delete the branch way

git very strong point is that management branch, branch other version management tools, git relative is lightweight, can create a feature, bug, development and other types of branches.

Use git, try each feature or bug would create a separate branch development, so easy to submit pull request, to facilitate code review, easy version rollback.

When we graphical deleted branches on github, gitlab when, in fact, just delete the branch git repository, the local branch is not deleted. So delete the local branch has the following steps:

1. Local delete remote branch br_name.

git push origin --delete br_name

2. Local delete local branch br_name.

git br -b br_name

br_name have been merged into master, or delete failed.

git br -D br_name

Force delete br_name, whether or not already fit into the master.

3.git br -a

View all branches of state, confirmed that the branch has been deleted.

Guess you like

Origin www.cnblogs.com/lionelgeng/p/12002165.html
Recommended