在开发中清理我的git功能分支 [英] Cleaning my git branch of features in development

查看:113
本文介绍了在开发中清理我的git功能分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来参加git派对的时间有点晚,我有一个简单的问题。



我有三个功能实验正在开发中,目前在我的主分支上。这些功能可以称为 postits auth 上传 在我的主分支上执行 git status ,我得到了'更改但未更新'中约10个条目的列表,以及'未跟踪文件'中约15个条目。所有这些条目属于三个功能实验之一。



如何将这些条目移动到三个新功能分支中,以便我可以再次拥有干净的工作目录?

解决方案

  $ git checkout -b postits#根据当前的master创建postits分支
$ git add XYZ#添加你的部件,也许用-p获取部分文件
$ git commit#提交postits分支
$ git checkout -b auth master#make master based master包括postits)
$#etc


I have come to the git party a little late and I have a simple problem.

I have three feature experiments in development that are currently on my master branch. The features could be called postits, auth, and uploads.

When I do git status on my master branch, I get a list of ~10 entries in 'changed but not updated' and ~15 in 'untracked files'. All these entries belong to one of the three feature experiments.

How can I move these entries into three new feature branches so I can have a clean working directory again?

解决方案

$ git checkout -b postits     # create postits branch based on the current master
$ git add X Y Z               # add your parts, maybe with -p to get parts of files
$ git commit                  # commit to postits branch
$ git checkout -b auth master # make branch based on master (not including postits)
$ # etc

这篇关于在开发中清理我的git功能分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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