单个开发人员需要git分支吗? [英] Is git branches necessary for a single developer?

查看:224
本文介绍了单个开发人员需要git分支吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名开发人员。我为我的项目使用git。
$ b $ p对于每一个功能(例如登录/注册页面),我创建一个新的分支来实现它。



稍后,我将该分支合并到我的主人中。



现在我有20多个分支机构,我觉得我正在以错误的方式做。



是否需要单个开发人员使用git分支?

解决方案

分支的主要目的是您可以不改变主机,稳定,而不是具有可能导致问题的部分完成功能。只有一个非主分支可以解决当前正在进行的功能的问题 - 删除所有旧分支。您可以避免以这种方式阻止发布,因为您不会说我们无法发布,因为功能X只有一半完成。



您也可以通过直接在主服务器上进行解决问题,但是直接在主服务器上进行密钥输入,以便用户不可见,直到完成为止。您需要良好的CI实践才能给您信心做到这一点。


I'm a single developer. I use git for my projects.

For every single feature (Ex. Login/register pages), I create a new branch to implement it

Later I merge that branch in my master.

Now I have like 20+ branches and I feel like i'm doing it in the wrong way.

Is git branches necessary for a single developer?

解决方案

The main purpose of the branch is that you can leave the master untouched and stable, rather than having part-completed features that may cause issues. You could solve the problem with just one non-master branch for the current in-flight feature - delete all the old ones. You can avoid holding up a release working this way, because you won't say "we can't release because feature X is only half complete".

You can also solve the problem by working directly in master, but key-stoning the feature so it isn't visible to users until it is complete. You need good CI practices to give you the confidence to do this.

这篇关于单个开发人员需要git分支吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆