Home >System Tutorial >LINUX >How to create and commit a new branch using git in Ubuntu system?

How to create and commit a new branch using git in Ubuntu system?

WBOY
WBOYforward
2023-12-29 17:50:02704browse

Today we will talk about how to use git to add a branch and submit it in Ubuntu. It is very simple. Please see the detailed introduction below.

1, git branch newbh , we create a new branch newbh.

How to create and commit a new branch using git in Ubuntu system?

2, git branch, you can see the current branches.

How to create and commit a new branch using git in Ubuntu system?

3, git checkout newbh, so that we can convert to the newbh branch.

How to create and commit a new branch using git in Ubuntu system?

4, git branch, you can use the color to identify that you have switched to this branch.

How to create and commit a new branch using git in Ubuntu system?

5. Modify the file.

git status

git add -A

Then we add it to the buffer area.

How to create and commit a new branch using git in Ubuntu system?

How to create and commit a new branch using git in Ubuntu system?

6, git commit -m "", Then we submit it to the local repository.

How to create and commit a new branch using git in Ubuntu system?

How to create and commit a new branch using git in Ubuntu system?

7, git push -u orgin newbh, then we can submit to the remote warehouse. git branch -a,View all branches.

How to create and commit a new branch using git in Ubuntu system?

The above is the detailed content of How to create and commit a new branch using git in Ubuntu system?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete