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

How to import a exist git repository into another git repository?

From
EHEdmond Halley <halleyinvent@gmail.com>
Date
Jan 5, 2011, 06:50 UTC
Message-ID
<AANLkTi=ahqFz=NVMrhtf+u2fJR_PAW-vcXgNYcce=2R+@mail.gmail.com>
Hi,
I have two exit repos A and B. I would like A becomes part of B. For example:
original:
A
|-- a.cpp
`-- Makefile
B
|-- b.cpp
`-- Makefile
combined:
B
|-- b.cpp
|-- Makefile
`-- A
    |-- a.cpp
    `-- Makefile
The git log of repo A is kept in the combined repo.
I try google but the following methods turn out they do not work like
what I want. I can not view the log of original repo A after
combining.
1) http://stackoverflow.com/questions/1683531/how-to-import-existing-git-repository-into-another
Fail at the following command.
git checkout -b ZZZ other/master
error: Untracked working tree file 'Makefile' would be overwritten by merge.
2) http://thread.gmane.org/gmane.comp.version-control.git/5126/
git log only give the lastest commit message. I do not know how to get
the log if orignal repo A.
Thank you!

Best regards, Halley

Next: Andrew Garber
Message 1 of 2 in “How to import a exist git repository into another git repository?”
  1. Edmond HalleyJan 5, 2011
  2. Andrew GarberJan 5, 2011

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.