Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the related operations of master, test and dev branches in Git

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "Introduction to the related operations of the master, test and dev branches in Git". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "Introduction to the related operations of the master, test and dev branches in Git" together.

Scenario 1: Remote repository has only one master branch, local master, test, dev three-branch solution is to directly create a new remote branch, git can not only create a new branch in the local, but also in the remote branch, local according to master After creating a good test branch: 1 git branch test master (Create a new local test branch from the local master branch) 2 git checkout test 3 git branch origin/test (Create a new remote origin/test branch from the current local test branch) 4 git push -u origin test (Associate the remote test branch with the local test branch, and commit the local test branch to the remote test branch) After 5, git pull/git push The same operation for creating a new dev branch: 1 git branch dev test2 git checkout dev3 git branch origin/dev4 git push -u origin dev5... Scenario 2: Remote repository has three branches: master, test, dev. You need to pull the remote repository locally and establish three local branches to associate with the remote. The first step is to pull the remote repository: git clone git@gitee.com blues/test.git If there are already three branches in the remote before pulling, you can pull them down during pulling. If you start to create them after pulling, you need to perform synchronous operations: git fetch This time, the operation is reversed. Create a local branch according to the remote branch: git branch test origin/test After performing the operation like this, there is no need to do the association operation, and the local test will automatically be associated with the remote origin/test. After switching to the local test branch, after modifying the commit, you can push it directly to the remote origin/test branch. The git checkout testdev branch is also: git branch dev origin/devgit checkout dev Thank you for reading, the above is the "Git master, test, dev three branches of the related operations introduced" content, after learning this article, I believe you have a deeper understanding of Git master, test, dev three branches of the related operations introduced this problem, the specific use of the situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report