{"thread":{"id":"33308","subject":"more git weirdness (git rebase, merge conflicts","startedAt":"2013-03-27T18:51:37Z","lastAt":"2013-03-28T16:04:32Z","messageCount":2,"participants":["J.V.","Magnus Bäck"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"212431","messageId":"51533FB9.7070307@gmail.com","threadId":"33308","inReplyTo":null,"subject":"more git weirdness (git rebase, merge conflicts","fromName":"J.V.","fromEmail":"jvsrvcs@gmail.com","sentAt":"2013-03-27T18:51:37Z","receivedAt":"2013-03-27T18:51:37Z","isPatch":false,"sender":{"key":"jvsrvcs@gmail.com","avatar":null},"body":"I have a local/development branch tracked to origin/development.  I made \nno changes to local/dev and did a git pull with rebase, I did not expect \nany conflicts.\n\nI got a conflict and was thrown onto another branch.  I attempted a \nmerge (using IntelliJ) accepting everything from the server but a \nvariable definition was missing for some odd reason and the merge was \nnot successful (merge was resolved but the file would not compile) so I \ndecided to simply go back to my dev branch and figure out how to do a \ngit pull -f (force overwrite of all local files so that I could get my \nlocal/dev back into sync with origin/dev.\n\nOn my screwed up branch that I was thrust onto:\nI typed:\n     $git rebase --skip            <= I was stuck in a rebase (rebase \nfailed, was thrown onto a tmp branch and thought this would get me out \nof there)\n\nNow I have been sitting here for an hour watching  \"Applying: <message\" \nscroll by and it looks like the messages are going backwards into the \npast one by one.  What the hell is happening?\n\n     Applying: add log information\n     Applying: <previous message\n     .... and it goes on and on and on.\n\nAll I want to do at this point is to get back to my dev branch and force \npull from origin/dev while keeping all local files that have not been \nadded to my local repo.\n\nHow do I stop this madness and get back to local dev and force pull from \norigin/dev     <= which is our master.\n\nAny help would be greatly appreciated.\n\n\nthanks\n\n\nJ.V.\n"},{"id":"212543","messageId":"20130328160431.GB23946@google.com","threadId":"33308","inReplyTo":"51533FB9.7070307@gmail.com","subject":"Re: more git weirdness (git rebase, merge conflicts","fromName":"Magnus Bäck","fromEmail":"baeck@google.com","sentAt":"2013-03-28T16:04:32Z","receivedAt":"2013-03-28T16:04:32Z","isPatch":false,"sender":{"key":"baeck@google.com","avatar":null},"body":"On Wednesday, March 27, 2013 at 14:51 EDT,\n     \"J.V.\" <jvsrvcs@gmail.com> wrote:\n\n> I have a local/development branch tracked to origin/development.  I\n> made no changes to local/dev and did a git pull with rebase, I did\n> not expect any conflicts.\n> \n> I got a conflict and was thrown onto another branch.  I attempted a\n> merge (using IntelliJ) accepting everything from the server but a\n> variable definition was missing for some odd reason and the merge\n> was not successful (merge was resolved but the file would not\n> compile) so I decided to simply go back to my dev branch and figure\n> out how to do a git pull -f (force overwrite of all local files so\n> that I could get my local/dev back into sync with origin/dev.\n> \n> On my screwed up branch that I was thrust onto:\n> I typed:\n>     $git rebase --skip            <= I was stuck in a rebase (rebase\n> failed, was thrown onto a tmp branch and thought this would get me\n> out of there)\n\nThe --skip option makes Git skip one commit in the rebase. To bail out\ncompletely and restore the original state, use --abort.\n\n> Now I have been sitting here for an hour watching  \"Applying:\n> <message\" scroll by and it looks like the messages are going\n> backwards into the past one by one.  What the hell is happening?\n> \n>     Applying: add log information\n>     Applying: <previous message\n>     .... and it goes on and on and on.\n\nYou initated a rebase with an incorrect base, so Git is rebasing all\npast history onto a new base. Say the upstream repository looks like\nthis, with uppercase letters denoting commits found on the upstream\nand lowercase letters being your local commits (if any):\n\n           ----------C\n          /\n     A----B---\n              \\\n               ------------D----E\n                           \\\n                            --a--b\n\nIn this example, you've made two commits since you started working on\ncommit D. The expected result for a rebase is for Git to rebase the two\ncommits you've made since D (a, b) and put them on top of E, the new\nbaseline fetched from the upstream. However, because of how you invoke\nthe rebase, Git actually thinks that C is the base of your local branch\nand computes all the commits you've made since C and finds all commits\nbetween B and b, which it now tries to rebase on top of C.\n\n> All I want to do at this point is to get back to my dev branch and\n> force pull from origin/dev while keeping all local files that have\n> not been added to my local repo.\n> \n> How do I stop this madness and get back to local dev and force pull\n> from origin/dev     <= which is our master.\n\nStart with \"git rebase --abort\" to get out of the rebase loop. To delete\nall your local uncommitted changes made to tracked files while keeping\nlocal/untracked files, run \"git reset --hard\". If you haven't made any\nlocal commits a correctly invoked rebase (or pull) will be a trivial\nfast-forward.\n\n-- \nMagnus Bäck\nbaeck@google.com\n"}]}