[racket-dev] Git

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu Jan 6 12:22:29 EST 2011

On Thu, Jan 6, 2011 at 12:06 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> On Thu, Jan 6, 2011 at 8:00 AM, Carl Eastlund <cce at ccs.neu.edu> wrote:
>> In case you find it to be an improved workflow, here's what I do: I
>> maintain cce/plt as a clone of plt.  I work on it, on whatever branch.
>>  Whenever I feel it has gotten too far behind -- which can be daily,
>> weekly, or whenever -- I run "git remote update" followed by "git
>> rebase plt/master".  Nearly all of the time, this runs without
>> complaint and puts me in a state where I have exactly the plt/master
>> history, plus my own edits following all of that.  So I can
>> continually develop, and push to plt only when I'm all done, but I
>> maintain a linear history (no forks-and-merges).  It also minimizes
>> the amount of "clobbering" I need to do.
> Thanks! I'm giving this a try.  I created robby/plt and then cloned
> it. Turns out that robby/plt was an old old copy of the main thingy
> (which I no longer know how to refer to).
> So I did this ("git" means "git.racket-lang.org" in my ssh setup as I
> did things that way before Eli's recommendation changed)
>  git clone git:robby/plt
>  git remote add plt git:plt
> and then "git remote -v" produced this:
>  origin  git:robby/plt (fetch)
>  origin  git:robby/plt (push)
>  plt     git:plt (fetch)
>  plt     git:plt (push)
> which seems like the right thing. So I did
>  git remote update
>  git rebase -v plt/master
> and I got lots and lots of messages about files changing which ended like this:
>   delete mode 100644 src/wxxt/utils/image/src/wx_imgx.h
>   delete mode 100644 src/wxxt/utils/image/src/wx_pbm.cc
>   delete mode 100644 src/wxxt/utils/image/src/wx_pcx.cc
>   delete mode 100644 src/wxxt/utils/image/src/wx_pm.cc
>   delete mode 100644 src/wxxt/utils/image/src/wx_xbm.cc
>  Nothing to do.
> and now I have this:
>  % git status
>  # On branch master
>  # Your branch and 'origin/master' have diverged,
>  # and have 2885 and 53 different commit(s) each, respectively.
>  #
>  nothing to commit (working directory clean)
> And now I'm a little bit worried. I'd have expected that I would get a
> message indicating that I was just straight ahead of origin/master
> instead of diverging from it.
> Does this mean that my robby/plt thing was not really from a point in
> the direct past of my plt/master?
> Any advice on what I should do now?

It looks like you had 53 commits that were pushed to plt/master in a
slightly modified form -- probably you had them locally, rebased a few
commits from plt/master, then pushed them, and robby/plt never got
updated to reflect the rebase.  The "Nothing to do" indicates those
diffs are reflected in plt/master, so you probably don't need to worry
about them.

If you have gitk or gitg you can run them to check if master is the
same revision as plt/master, or you can run "git log plt/master..HEAD"
to see if you have any lingering commits.  But I think you don't.  In
any event, you can resync robby/plt to what you currently have by

git push --force

>From there you'll be ready to do whatever you need to do.


Posted on the dev mailing list.