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

How to create a branch in Git

藏色散人
Release: 2018-11-21 09:53:24
Original
26524 people have browsed it

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
Copy after login

Then the command statement to create the branch is:

git branch +  分支名
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template