This article mainly introduces How to create a branch in Git.
Git, a distributed version management system. So in the previous article, we have introduced to you what Git branches are and how to view branches. The so-called Git branch means that you can separate your work from the main development line so as not to affect the main development line.
And almost all version control systems support branches in some form.
We have already talked about how to view branches before.
The command statement to view the branch is:
git branch
Then the command statement to create the branch is:
git branch + 分支名
Below we can Perform a simple branch creation operation:
As shown below, we open the Git command line tool in the specified folder directory.
Then create a branch named test through the git branch test statement. Then view all branches through git branch.
As shown above, there are currently two branches, master and test. The master branch here displays green to indicate that our current location is in this branch directory.
This article is an introduction to the method of Git creating a branch. It is very simple and easy to understand. I hope it will be helpful to friends in need!
The above is the detailed content of How to create a branch in Git. For more information, please follow other related articles on the PHP Chinese website!