{"thread":{"id":"60530","subject":"What is the best way to fix divergent branches during push","startedAt":"2023-11-15T23:43:37Z","lastAt":"2023-11-15T23:43:37Z","messageCount":1,"participants":["Mun Johl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"484953","messageId":"SJ0PR04MB8289AF64E6C9EDED7B6D7A9B9CB1A@SJ0PR04MB8289.namprd04.prod.outlook.com","threadId":"60530","inReplyTo":null,"subject":"What is the best way to fix divergent branches during push","fromName":"Mun Johl","fromEmail":"mun.johl@wdc.com","sentAt":"2023-11-15T23:43:32Z","receivedAt":"2023-11-15T23:43:37Z","isPatch":false,"sender":{"key":"mun.johl@wdc.com","avatar":null},"body":"Hi all,\n\nOur team recently moved from SVN to git and occasionally we get our workspace in a snarl.  I could use some advice on the best way to resolve our issue.\n\nIn general, this is what happens:\n\n1. git pull\n2. bunch of edits which could last hours to days\n3. git add\n4. git commit\n4a. sometimes there is a delay here before the next step because the user forgets a push is needed; but that is not always the case and the end results are the same\n5. git push\n\nAt this point we have divergent branches.  Not surprising.  However, some users say no matter if the try a pull with ff-only, merge, or rebase that they get errors from git (sorry, I don't have the exact error text--but I hear 'git pull' continues to complain about divergent branches).\n\nWhat is the recommended method to correct the divergent branches issue so that the 'git push' can proceed successfully?\n\nAre the steps outlined above incorrect?  Should we insert the following steps:\n\n2.a  git stash\n2.b  git fetch\n2.c  git pull\n2.d  git stash pop\n\nI think the added steps may minimize the probability of divergent branches, but it is certainly not ensuring divergent branches will not occur.\n\nAny advice in this regard would be greatly appreciated.\n\nBest regards,\n\n-- \nMun\n\n"}]}