In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge points about how git converts branches. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
In git, you can use the checkout command to convert branches, which is used to switch branches or restore the working tree file with the syntax "git checkout branch name"; when the parameter is set to "- b", you can switch branches at the same time the new branch is created, with the syntax "git checkout-b branch name".
This article operating environment: Windows10 system, Git2.30.0 version, Dell G3 computer.
How does git convert branches
The most common use of checkout is to switch between work branches:
Git checkout branchName
This command switches the current working branch to branchName. In addition, you can switch branches while a new branch is created with the following command:
Git checkout-b newBranch
This command is equivalent to the execution of the following two commands:
1. Git branch newBranch 2. Git checkout newBranch
The complete body of the order is:
Git checkout-b |-B []
First of all through
$git branch-a
To view the branches of the directory in which they are located
$git branch-a master* trunk remotes/origin/HEAD-> origin/master remotes/origin/master remotes/origin/zhanghanlun
Then enter the command to switch branches
For creating and switching branches for the first time
$git checkout-b zhanghanlun origin/zhanghanlun
Where the remote branch is origin/zhanghanlun
The local branch is zhanghanlun
If there is already a local branch
Enter the command directly
Git checkout zhanghanlun
Switch to a branch that is locally zhanghanlun
These are all the contents of the article "how to convert branches of git". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.