"Luck, Tony" <[EMAIL PROTECTED]> writes:

> I see that when I switch view to a different
> branch with:
>       $ git checkout -f someoldbranch
> that any files that exist in my previous branch view
> but not in "someoldbranch" are not deleted.
> ... I wondered whether this was a deliberate choice

Not really.

When possible, please use "git checkout" without -f.  That form
uses "git-read-tree -u -m", which can tell from your current
index file what's changed and what's going away.  This is only
possible if read-tree can rely on what is in your index file
actually matches the status of your working tree, and the -f
flag to checkout is to work around cases where you cannot give
that guarantee to read-tree and would want/need to start over
from scratch.  With -f flag, you are telling git-read-tree to
ignore what is currently recorded in your index file, hence what
should be in your working tree before checkout.  There is no way
for git-read-tree to tell which are source files that exist only
in the old thing you had checked out before (i.e. should be
removed) and which are files your build procedure left and/or
files you made by hand outside of SCM control (i.e. should be
kept) without that information, so that is why those files were
left behind.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to