<p>This sounds like a problem for <a href="https://git-scm.com/docs/git-cherry-pick" rel="nofollow noreferrer"><code>git cherry-pick</code></a>. If you can separate the user story code from the fix code, by committing them separately, you can cherry pick the relevant commit to merge back into the <code>develop</code> branch.</p>

<p>See <a href="https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean">https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean</a></p>

CC BY-SA 4.0
2019-01-31T11:25:32.587Z
git cherry-pick is not working as there are lot no of files, being committed in different commit IDs and maybe I am missing something here but getting all those commit ID and files is proving to be difficult.

Is there some other Git-flow maybe to achieve this?
Thanks
Dev Kamal
CC BY-SA 4.0
2018-11-15T12:27:56.943Z
2018-11-15T12:27:56.943Z
Bruce Becker
<p>I am new to DevOps. I am using Jenkins and GitHub for salesforce deployment.</p>

<h2>Setup</h2>

<p>We have a <code>develop</code> branch. Feature branches are created out of it. When merged to <code>develop</code>, the deployment to the first Salesforce sandbox happens. After end of every sprint the <code>develop</code> branch is merged with SIT branch pushing changes to SIT Sandbox.</p>

<h2>Problem Statement</h2>

<p>The QA happens in the 1st sandbox for sprint 2. QA also takes place in SIT Sandbox for sprint n-1 features.</p>

<ol>
<li>If an issue is found in the SIT sandbox as part of sprint n-1 testing, the bug is fixed in the <code>develop</code> Sandbox

<ol>
<li>a defect feature branch is created from <code>develop</code>. </li>
<li>A fix is added to it. </li>
<li>The branch is merged to develop, fix deployed to 1st Sandbox and tested. </li>
</ol></li>
<li>If it passes QA, the defect feature branch needs to be  merged with the SIT branch to deploy the fix to the SIT sandbox and testing resumes.</li>
</ol>

<h2>Issue</h2>

<p><strong>Only the fix</strong> needs to be pushed to SIT before the sprint is over and not user story code from sprint 2. But if the fix is made to an apex class or object file, everything is deployed.</p>

<p><strong>How would one separate the user story code from sprint 2 and defect fix code for sprint n-1 testing when merging to SIT branch?</strong></p>

CC BY-SA 4.0
2018-11-15T12:11:43.490Z
hi there- what do you mean by SIT?
Bruce Becker
CC BY-SA 4.0
2018-11-16T13:17:16.003Z
SIT here refers to 2nd Salesforce Sandbox where the code needs to be deployed.
Dev Kamal
<jenkins><continuous-integration><git><github>
Push specific changes (defect fix) and not feature changes
Dev Kamal
# Push specific changes (defect fix) and not feature changes

(Asked by: username_0 on 2018-11-14)

I am new to DevOps. I am using Jenkins and GitHub for salesforce deployment.

## Setup

We have a `develop` branch. Feature branches are created out of it. When merged to `develop`, the deployment to the first Salesforce sandbox happens. After end of every sprint the `develop` branch is merged with SIT branch pushing changes to SIT Sandbox.

## Problem Statement

The QA happens in the 1st sandbox for sprint 2. QA also takes place in SIT Sandbox for sprint n-1 features.

1. If an issue is found in the SIT sandbox as part of sprint n-1 testing, the bug is fixed in the `develop` Sandbox
   1. a defect feature branch is created from `develop`.
   2. A fix is added to it.
   3. The branch is merged to develop, fix deployed to 1st Sandbox and tested.
2. If it passes QA, the defect feature branch needs to be merged with the SIT branch to deploy the fix to the SIT sandbox and testing resumes.

## Issue

**Only the fix** needs to be pushed to SIT before the sprint is over and not user story code from sprint 2. But if the fix is made to an apex class or object file, everything is deployed.

**How would one separate the user story code from sprint 2 and defect fix code for sprint n-1 testing when merging to SIT branch?**

**Tags:** jenkins, continuous-integration, git, github

> **Comments:**
> **username_1**: hi there- what do you mean by SIT?  
> **username_0**: SIT here refers to 2nd Salesforce Sandbox where the code needs to be deployed.  

---

## 1 answers

### Answer by username_1 on 2018-11-15. Score: 4

This sounds like a problem for [`git cherry-pick`](https://git-scm.com/docs/git-cherry-pick). If you can separate the user story code from the fix code, by committing them separately, you can cherry pick the relevant commit to merge back into the `develop` branch.

See <https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean>

> **Comments:**
> **username_0**: git cherry-pick is not working as there are lot no of files, being committed in different commit IDs and maybe I am missing something here but getting all those commit ID and files is proving to be difficult.  Is there some other Git-flow maybe to achieve this? Thanks  

---

