Click here to Skip to main content
15,913,210 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: CCC 14/12/16 - SOLVED Pin
PeejayAdams14-Dec-16 3:13
PeejayAdams14-Dec-16 3:13 
GeneralGit branches problem Pin
Super Lloyd13-Dec-16 13:56
Super Lloyd13-Dec-16 13:56 
GeneralRe: Git branches problem Pin
Jon McKee13-Dec-16 15:17
professionalJon McKee13-Dec-16 15:17 
GeneralRe: Git branches problem Pin
Super Lloyd13-Dec-16 20:49
Super Lloyd13-Dec-16 20:49 
GeneralRe: Git branches problem Pin
englebart15-Dec-16 2:10
professionalenglebart15-Dec-16 2:10 
GeneralRe: Git branches problem Pin
Slacker00714-Dec-16 0:46
professionalSlacker00714-Dec-16 0:46 
GeneralRe: Git branches problem Pin
Mark_Wallace13-Dec-16 20:30
Mark_Wallace13-Dec-16 20:30 
AnswerRe: Git branches problem PinPopular
Nagy Vilmos13-Dec-16 21:49
professionalNagy Vilmos13-Dec-16 21:49 
Short answer:
Have you considered a commit by commit merge from dev to prod using git cherry-pick[^]?

Long answer:
As for the overall strategy, I'd say it is wrong! Whoever authorised changing the production branch should be taken out back and given a damned good explaination of how and when to change a branch!

Let's start at the very beginning...

master is the head revision of released code. No development should be checked in here, this is your latest and greatest release to the wild.
production should be master plus anything being deployed. Again no development! The only commits are part of building the artifacts for release. Once built and tested it is merged back to master as the last step of the release.
development is where all the changes being prepared for release go. And no, you can't check development into development. Each user should branch of development and merge back completed changes.

So far, so good. That is a pretty normal work flow, and makes sure that nothing gets into the relase branch that shouldn't be there. Now for your problem.

Feck! production is being updated for the next release and so shouldn't be touched; *snigger*.
Branch from the tag in master at the release. Create the new branch hotfix-x; where 'x' is the version as you may have moire than one hot fix. This is equivalent to production but is behind development and that's an important distinction. Normally changes are merged at the head from development to production, here we do it piecemeal. So let us begin...

We will start with a dev change. First find the commit hash in the development branch. From hotfix-x do a cherry pick merge - git cherry-pick <hash>; one change done and dusted.
Now we have the problem of the idiot having changed production. Slap the idiot then find the commit hash and guess what you do next? Cherry pick is your friend today.
I personally would recommend merging from development to hotfix-x as much as you can. If there is a change that can only be applied to the older code then better branch from hotfix-x to hotfix-name-the-change Make the changes, unit test and merge back to hotfix-x then merge again to development.

When everything is sorted out, kick the eejit and test from hotfix-x as you would from production If this is all on top of master then it should be merged back, see above, when it is released.
veni bibi saltavi

GeneralRe: Git branches problem Pin
Kunal Chowdhury «IN»13-Dec-16 22:31
professionalKunal Chowdhury «IN»13-Dec-16 22:31 
GeneralRe: Git branches problem Pin
Super Lloyd14-Dec-16 13:39
Super Lloyd14-Dec-16 13:39 
GeneralRe: Git branches problem Pin
megaadam13-Dec-16 22:21
professionalmegaadam13-Dec-16 22:21 
GeneralRe: Git branches problem Pin
dazfuller14-Dec-16 20:20
dazfuller14-Dec-16 20:20 
GeneralRe: Git branches problem Pin
Super Lloyd14-Dec-16 21:57
Super Lloyd14-Dec-16 21:57 
GeneralRe: Git branches problem Pin
mbb0115-Dec-16 0:52
mbb0115-Dec-16 0:52 
GeneralRe: Git branches problem Pin
Gerry Schmitz15-Dec-16 8:18
mveGerry Schmitz15-Dec-16 8:18 
JokeA very French problem... Pin
R. Giskard Reventlov13-Dec-16 12:49
R. Giskard Reventlov13-Dec-16 12:49 
GeneralA very German problem... Pin
CDP180213-Dec-16 12:52
CDP180213-Dec-16 12:52 
GeneralRe: A very German problem... Pin
Jochen Arndt13-Dec-16 21:40
professionalJochen Arndt13-Dec-16 21:40 
GeneralRe: A very German problem... Pin
CDP180213-Dec-16 21:48
CDP180213-Dec-16 21:48 
GeneralRe: A very French problem... Pin
Chris Maunder13-Dec-16 13:34
cofounderChris Maunder13-Dec-16 13:34 
GeneralRe: A very French problem... Pin
W Balboos, GHB14-Dec-16 0:29
W Balboos, GHB14-Dec-16 0:29 
GeneralA very American problem... Pin
Jeremy Falcon13-Dec-16 14:53
professionalJeremy Falcon13-Dec-16 14:53 
GeneralRe: A very American problem... Pin
Jon McKee13-Dec-16 15:09
professionalJon McKee13-Dec-16 15:09 
GeneralRe: A very American problem... Pin
lopati: loaming13-Dec-16 17:32
lopati: loaming13-Dec-16 17:32 
GeneralRe: A very American problem... Pin
Jon McKee13-Dec-16 18:22
professionalJon McKee13-Dec-16 18:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.