Michael <keybou...@gmail.com> writes:

> (I hope this isn't considered "advanced" git.)
>
> So I just recently found out about worktrees, that let you have two
> different working trees from the same repository. (NB: Originally, I
> thought I had learned that git only supported one work tree per
> repository, but had a special "hardlink" to let two repositories share
> disk space on the same drive -- did I misunderstand something?).
>
> Now, there's submodules, and subtrees. I'd like a bit of an
> explanation here.
>
> A submodule is at least at first simple enough: you have a subproject
> with it's own history. But that's about all I understand about it.
>
> I can't tell if there's any way to convert a sub directory of a
> project into a submodule, or visa-versa, or if it is a "lifetime"
> choice.

I've taken submodules in both directions, but I would consider it
advanced git usage. When I did that it required rewriting history, but
if I had to do it today I'd use `git-subtree`, as its manpage says:

  For example, if a library you made for one application ends up being
  useful elsewhere, you can extract its entire history and publish that
  as its own git repository, without accidentally intermingling the
  history of your application project.

> And the man page on submodules talks about a "subtree merge strategy",
> and I'm not sure I've even heard that before.

A quick search offered up this:
https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html

/M

--
Magnus Therning              OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe               http://therning.org/magnus

Some operating systems are called 'user friendly', Linux however is
'expert friendly'.

-- 
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.

Attachment: signature.asc
Description: PGP signature

Reply via email to