How to cherry-pick from superproject repo to subfolder repo?

191 views Asked by At

After splitting a subfolder out into a new repository can you still use the original repo as a remote and cherry-pick pruned commits to the new repository.

The only option I could think of is getting the filter-branch the second time, pushing it as a second remote, then cherry-pick from the second remote to the new repository.

I don't know if this would be the reverse submodules or reverse subtrees.

1

There are 1 answers

1
jthill On

Git's really flexible about things like this. If your other repo's on a shared filesystem you can even

GIT_ALTERNATE_OBJECT_DIRECTORIES=/path/to/other/repos/.git/objects \
git cherry-pick $itssha1