On 01/06/2013 02:50 PM, Andrei Alexandrescu wrote:
Sent this to dmd-internals, opening for a broader discussion:

Hello,


I wonder how we can define a few aliases of project-wide usefulness to
git. For example, I tried today to get the latest and greatest phobos
into my repo, and got a bunch of conflicts. I searched a while on the
net to figure what the command for "just get the latest remote into my
local copy", which is entirely possible but not obvious and not easy to
find.

If you use local branches instead of working directly on master then getting the latest and greatest is as simple as

  git checkout master
  git pull

Then you can do

  git checkout mybranch
  git rebase master

to get new upstream changes into your local branch(es). You might sometimes need to use more complicated versions of the rebase command, but no matter how wacky things get with merge conflicts, it will only be affecting your local branch. (I often do "git checkout mybranch; git checkout -b newmybranch; git rebase master", if I'm worried about conflicts; this way I have a new branch to play around with fixing conflicts in, and it's easy to just scrap it and switch back to known-good versions of master and local branches).

tl;dr: more local branches means less need for arcane git options.

--Ed

Reply via email to