Re: git bug: Including a git repository in a directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 06.06.22 um 07:43 schrieb Steven Jonn Edlefsen:
> Git cannot commit/push a directory with a git repository in
> a sub-directory.
>
> The sub-directory with the git repository and the directories below
> are set to the “master” branch, while the directories above remain
> set to the new branch.
>
> When the top directory is committed, the sub-directory with the
> git repository appears as an empty file.
>
> Even when the subdirectory branch name is changed from master
> to the new branch and the top directory is re-commited/pushed,
> the same problem occurs.
>
> When the git repository in the sub-directory is removed, e.g.
> the .git file is removed, and top directory is committed/pushed,
> the subdirectory has all the sub-directories and files.

This is intended behavior.  A repository inside another one needs
special handling.  Git provides the submodule feature for that.  A
simpler alternative for some use cases is called subtree.

That's all I can tell you, as I haven't used submodules and subtrees
myself.  At least I hope these keywords help you explore your options.
Others will probably chime in with advise on which one to use if you
explain _why_ you want to combine multiple repositories.

René




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux