git/list[1] front-page[2] threads[3] people[4] search[5] about
 

how to add a (history-laden) subdirectory into a repo?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Dec 13, 2019, 10:00 UTC
Message-ID
<alpine.LFD.2.21.1912130447510.5127@localhost.localdomain>
  (i suspect there's an easy solution -- possibly involving
filter-branch or elijah newren's git-filter-repo, or possibly
something even simpler, so let me try to be brief.)
  i have a xilinx petalinux (vendor) repo that i started from scratch,
with a certain amount of history that i would like to hang onto --
assume the top-level structure (as created by the petalinux-create
tool) is:
  board_name/
    dir1/
    dir2/
    ... etc etc ...

and so on, and so on. that is the structure of my current repo, totally isolated from other content.

  now, at this client site, they're using petalinux, but their
existing repository buried the petalinux project content inside a
larger build infrastructure that involves docker and other tools, so
the client's single repo has the structure:
  client_repo/
    blah1/
    blah2/
      woof1/
      woof2/
      board_name/      <---- subdir content in client repo
        dir1/
        dir2/
        ... etc etc ...

from my perspective, the ideal solution would have been for the client to develop its build infrastructure, and include the PL project as a submodule or subtree, as that content really is independent from the build infrastructure but, for whatever reason, the above is all just one honking big repo with commits to the build content intermixed with content related to the PL project.

  i'd like to add my PL repo into that structure -- as you can see,
all my commits will be relative to the dir structure "board_name/",
while the corresponding content in the client repo will be relative to
"client_repo/blah2/woof2/board_name/".
  if submodules or subtrees are not an option, what is the easiest way
to insert my content into the appropriate subdirectory in the client
repo, while retaining my history? i'm sure there's a simple way to do
this, it just escapes me at the moment.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Next: Elijah Newren
Message 1 of 3 in “how to add a (history-laden) subdirectory into a repo?”
  1. Robert P. J. DayDec 13, 2019
  2. Elijah NewrenDec 13, 2019
  3. Junio C HamanoDec 13, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.