On Mon, 2015-11-09 at 10:01 +0000, Phillip Lord wrote:
> Now I pull to "~/src/my-repo" so it updates
> say master (or feature-branch). In ~/src/my-repo-branch/master running
> git log will show the latest commits to master, but the working
> directory will be out of date.

Konstantin gives you excellent details.  However, I follow a simple rule
which lets me avoid these concerns: I never pull in the "real" repo (in
your example, I never pull in "~/src/my-repo").  In fact, I never use
that repo directly at all: I don't even cd to it.  You can/should just
pull in your workdirs.

As long as all your workdir copies of the "real" repo are using
different branches, and you don't mess around with the contents of the
"real" repo yourself, you won't have any issues with new-workdir.

Of course when you're delivering code (for example, into master) then
you need to check out master in one of your workdirs which breaks the
above rules.  I personally only ever use new-workdir for personal
branches, so I never make a new-workdir that is set to master.  I merge
back one of my personal branches in its workdir back to master, then I
*delete* that workdir (if I'm done) or set it back to the personal
branch or check out a new personal branch.  I never let a workdir sit
with "master" checked out.

If you do need to have "master" checked out in more than one workdir
then Konstantin's instructions on how to manage it are spot-on.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to