0

I'm a little new to gitflow and I haven't been able to find an answer for this.

Suppose we have a release branch called release/0.1. While it's being currently tested and reviewed, etc, you're developing other newer features and merging it into the develop branch.

Now, suppose you remembered, that you need to develop and add a missed feature into release/0.1. How would you do this, without checking out into a new branch from develop? Or would you have to checkout into a new branch from release/0.1, but then how would you merge this new missed feature into develop later?

Mike K
  • 7,621
  • 14
  • 60
  • 120
  • Maybe cherry pick is what you need? With it you can select single commits from another branch and add it to your current branch. [Git - git-cherry-pick Documentation](http://git-scm.com/docs/git-cherry-pick) – dall Aug 11 '21 at 07:56
  • Will it merge over only the commits/changes? Or, with it, it would also take the current version of all files that are in develop? – Mike K Aug 11 '21 at 08:09
  • I understood that it just tries to apply the delta of the commit you cherry pick. Which includes that it just applies to the files that have been changed in the commit. You might still have to resolve some conflicts in the affected files. – dall Aug 11 '21 at 09:36

1 Answers1

2

It seems cherry pick is what you need. With it you can select single commits from another branch and add it to your current branch.

Documentation here: http://git-scm.com/docs/git-cherry-pick

A good summary of what cherry picking does, taken from https://stackoverflow.com/a/58822275/2244919 :

  • all files added by this commit will be added
  • all files deleted by this commit will be deleted
  • all files modified by this commit will be merged
dall
  • 102
  • 1
  • 10