Home  >  Article  >  Development Tools  >  How to create a branch in Git

How to create a branch in Git

藏色散人
藏色散人Original
2018-11-20 16:22:0526497browse

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.

How to create a branch in Git

Then create a branch named test through the git branch test statement. Then view all branches through git branch.

How to create a branch in GitAs 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is a Git branch?Next article:What is a Git branch?

Related articles

See more