I am confronted with a challenging situation. The project I am working on has two git branches (master and develop). I have been working on a number of issues on the develop branch. All commits have been made directly on the develop branch (separate branches are not used for different issues). Commits for a particular issue can be identified by the commit message, as each commit message starts with the issue id (e.g. all commit messages for issue #231 will begin with "#231").
After testing locally, the changes for these various issues have be deployed to the owner's User Acceptance Testing (UAT) server. Since the project has no staging/testing branch, the develop branch has been merged into master and pulled into the master branch on UAT. As a result the master branch on UAT contains all the latest changes from develop branch. Further more this puts the master branch on UAT ahead of the Master branch on the production (PROD) server.
The site owner has now said that he would like to deploy all the changes for one of the issues (e.g. #231) onto PROD separately before deloying the rest.
The question I have is how best to achieve this?
The method I thought of was to create a new branch on PROD based on the current master branch on PROD (e.g. git branch master_231
). I could then pull this down to my local environment and cherry-pick the #231 commits into it. Once this is done I could pull the changes to master_231 back into PROD. Hopefully that would address the issue of deploying issue #231 changes to PROD.
In terms of bringing in the other changes on UAT server, I could log into PROD and checkout master branch (remembering we are currently on master_231). I can then pull the latest master changes into PROD. That would mean the master branches on UAT and PROD now match.
Given that master branch already contains the same commits as those in master_231 branch (remember that all issue #231 commits were originally on master), do I still need to merge master_231 into master on PROD? And if I did, would I get merge conflicts?
I reaslize there are several questions in there but I would love to get some feedback on this overall approach.