-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
I've been trying to figure out if there is a way to import an external project into a subtree and keep history continous for external consumers of that repo (i.e. let git pull
work with a new josh-backed upstream on old checkouts). Ideally all commit hashes would also be preserved.
I've tried a couple of things, such as:
- Clone an empty josh workspace at the target path. Add the original remote there, reset to its
HEAD
, push back to josh with-o create
. This creates a history where all the original commits are rebased on the history of the repository, in which case pulling is possible as long as rebasing on pulling is enabled.
This is as close as I've gotten to doing what I want, but it loses all the original commit IDs, which is not ideal. - Clone an empty workspace at the target path. Create an empty base commit, add the original remote, create a merge commit with it. Push back to josh with
-o create
. Josh flattens the merge commit and original history is lost. - Create a placeholder file in the monorepo to ensure the path has an existing history. Clone it with josh, merge the history from the remote as above. History is lost again in the same way.
What I sort of expected: In the first version, I expected the push back to synthesize a merge commit with the original history instead of rebasing the commits on top of it.
Any ideas on how to accomplish this? If we figure it out I'll contribute some docs for it.
Metadata
Metadata
Assignees
Labels
No labels