如何撤消git flow功能完成? [英] How to undo git flow feature finish?

查看:164
本文介绍了如何撤消git flow功能完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习git-flow,我只是做了 git flow feature finish< feature-name> ,它合并了我的特性分支以开发并删除它。 p>

与此相反,我想将功能分支推送到github,所以我可以在同行评审后将其合并。



<所以问题是,我该如何'撤销'这个命令。或换句话说,我如何将最后两次提交从开发移到我的功能分支? 解决方案

这些步骤应该做到诀窍:

获取需要的sha:

$ p $ g $ git log

< sha1> 合并

< sha2> 是开始使用该功能之前开发的最后一次提交。

  git checkout develop 
git checkout -b feature /< feature-name>
git reset< sha1> --hard
git checkout develop
git reset< sha2> --hard

推送您的功能分支。


I am learning git-flow and I just did git flow feature finish <feature-name>, which merged my feature branch to develop and removed it.

Instead of this, I want to push the feature branch to github, so I can merge it after a peer review.

So the question is, how do I 'undo' this command. Or in other words , how can I move my last two commits from develop to my feature branch?

解决方案

These steps should do the trick:

Get the sha's needed:

git log

<sha1> is the commit right before the merge
<sha2> is the last commit on develop before you started working on the feature

git checkout develop
git checkout -b feature/<feature-name>
git reset <sha1> --hard
git checkout develop
git reset <sha2> --hard

Push your feature branch.

这篇关于如何撤消git flow功能完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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