Home Development Tools git How to create a branch in Git

How to create a branch in Git

Nov 20, 2018 pm 04:22 PM

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:

1

git branch

Copy after login

Then the command statement to create the branch is:

1

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!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to push the specified commit How to push the specified commit Mar 06, 2025 pm 01:39 PM

How to push the specified commit

How to use git management tools for complete usage of git management tools How to use git management tools for complete usage of git management tools Mar 06, 2025 pm 01:32 PM

How to use git management tools for complete usage of git management tools

The difference between commit and push of git The difference between commit and push of git Mar 06, 2025 pm 01:37 PM

The difference between commit and push of git

How to solve the failure of git commit submission How to solve the failure of git commit submission Mar 06, 2025 pm 01:38 PM

How to solve the failure of git commit submission

How to view commit contents How to view commit contents Mar 06, 2025 pm 01:41 PM

How to view commit contents

The difference between add and commit of git The difference between add and commit of git Mar 06, 2025 pm 01:35 PM

The difference between add and commit of git

What is git code management tool? What is git code management tool? What is git code management tool? What is git code management tool? Mar 06, 2025 pm 01:31 PM

What is git code management tool? What is git code management tool?

Tutorial on using git commit Tutorial on using git commit Mar 06, 2025 pm 01:36 PM

Tutorial on using git commit

See all articles