简体   繁体   English

Git 新空分支的工作流程

[英]Git Workflow for a new empty Branch

I have a master branch with a Vue project.我有一个带有 Vue 项目的主分支。 Now I decided to use Quasar as a CSS Framework and therefore I need a new setup/project.现在我决定使用 Quasar 作为 CSS 框架,因此我需要一个新的设置/项目。 I want to use the same Git Repo so my Question is if there is a best practice workflow for something like this?我想使用相同的 Git 回购所以我的问题是是否有这样的最佳实践工作流程? So actually I need a new empty branch which should be later on the new master as soon as the Quasar Project is at the same level as the master.所以实际上我需要一个新的空分支,一旦 Quasar Project 与 master 处于同一级别,它就应该在新的 master 上。

I'm assuming that your main branch is master .我假设您的主要分支是master If not, change the commands below to the correct branch name.如果没有,请将以下命令更改为正确的分支名称。

Create a new work branch:创建一个新的工作分支:

git checkout -b quasar master

Then, modify your code (adding commits etc) and once it works, merge it back:然后,修改您的代码(添加提交等),一旦它工作,将其合并回来:

git checkout master
git merge quasar

If you don't change master while developing on quasar , this should work without problems.如果您在quasar上开发时不更改master ,这应该没有问题。 Otherwise, you might have to resolve conflicts if you modify some code in different ways on the two branches.否则,如果您在两个分支上以不同的方式修改某些代码,您可能必须解决冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM