home | list info | list archive | date index | thread index

[OCLUG-Tech] simple question about deleting a branch in git

  perusing o'reilly's "version control with git (2nd ed)", doing more
proofreading possibly in preparation for a 3rd edition, and ran across
this passage about deleting branches i hadn't noticed before:

"Git won’t allow you to delete a branch that contains commits that are
not also present on the current branch. That is, Git prevents you from
accidentally removing development in commits that will be lost if the
branch were to be deleted."

  hang on, that sounds contradictory. the first line claims that git
won't allow you to delete a branch that contains commits not on the
*current* branch, but the second line sounds more general in that git
doesn't want you to delete a branch where you might lose work, but as
long as the deleted branch commits are present on *some* branch (not
necessarily the current one), you should be fine.

  can someone clarify this? is this as confusing as it seems to be to
me?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================