Branching is a powerful tool for code management. If there is no effective branch management. Code management can not adapt to complex development processes and
The needs of the project.
Overview of BRANCH Commands:
Branch management in git uses the command git branch. The main usage of this command is as follows:
Usage One: Git branch
Usage II: GIT branch <branchname>
Usage three: Git branch <branchname> <start-point>
Usage four: git branch-d <branchname>
Usage five: git branch-d <branchname>
Usage Six: git branch-m <oldbranch> <newbranch>
Usage Seven: git branch-m <oldbranch> <newbranch>
Description
Usage 1: Used to display a list of local branches.
The current branch appears as a special color in the output and is identified with an asterisk "*".
Usage 2 and Usage 3 are used to create a branch. Usage 2 creates a branch based on the commit that the current head pointer (head) points to.
The branch name of the new branch is <branchname> Usage 3 is based on submit <start-point> create new branch, new branch name is <<branchname>
Usage 4 and Usage 5 are used to delete a branch.
Usage 4 When you delete branch <branchname>, it checks whether the deleted branch has been merged into another branch, or refuses to delete it.
Usage 5 Forces the deletion of the branch <branchname>, even if the branch is not merged into any one branch.
Usage 6 and Usage 7 for renaming branches
If a branch named <newbranch> already exists in the repository, usage 6 refuses to rename, and usage 7 enforces it.
To demonstrate the management of a branch:
I clone down a project. Put it in the work area.
About the branch of Git