Re: Your branch and 'origin/master' have diverged
- From
- Hilco Wijbenga <hilco.wijbenga@gmail.com>
- Date
- Aug 14, 2012, 17:07 UTC
- Message-ID
- <CAE1pOi0UJYhFXYi_GQyK7EL+wifu1g-R34wgqHCcKpdhirytuw@mail.gmail.com>
- In-Reply-To
- <CAJsNXTmUB-isPVHPcWupL-gAag--DzhdkazXj0Z+aEbv+_w7Rg@mail.gmail.com>
On 14 August 2012 09:02, PJ Weisberg <pj@irregularexpressions.net> wrote:
Show 25 quoted lines
> On Mon, Aug 13, 2012 at 12:58 PM, Hilco Wijbenga > <hilco.wijbenga@gmail.com> wrote: >> Hi all, >> >> A colleague of mine (after a relatively long absence) noticed the >> following when running "git status": >> >> # On branch master >> # Your branch and 'origin/master' have diverged, >> # and have 250 and 19 different commit(s) each, respectively. >> # >> nothing to commit (working directory clean) >> >> He asked me what to do and I told him to do what has always worked for >> me in the past when something like this happened: gitk, "reset master >> branch to here" (to a commit before the divergence and using --hard), >> git pull origin master. Problem solved. >> >> Well, not this one. This one is persistent. :-) I am at a loss what to >> do. "master" and "origin/master" do *not* point at the same commit. >> Even after the "git reset --hard ..." and "git pull". Running my >> silver bullet solution gets us in the same situation every time. > > I assume that the commit you reset to wasn't actually before the > divergence, then.
It was according to gitk.
Show 6 quoted lines
> It sounds like what you're trying to do is just > long-hand for 'git reset --hard origin/master'. As mentioned before, > that *does* assume that you want to throw out everything you've > committed locally. If that's *not* the case, try 'git rebase > origin/master' or 'git pull --rebase'. And then go slap the person > who rewrote the history of origin/master.
I'm not convinced anything is wrong with origin/master. This particular colleague is the only one with a problem. And not for the first time. :-)