Suppose I have a monorepo whose directory is named monorepo
. In the multirepo, each project has its own directory. Also suppose I have another existing repository named project-a
that I wish to place into the monorepo.
To place project-a
into the existing multirepo, I did this (taken from this question):
# Prepare project-a.
cd ~/project-a/
mkdir project-a/
mv * project-a/
git add --all
git commit -am 'Move all files into a directory in preparation for conversion to monorepo'
# Place project-a into the monorepo.
cd ~/monorepo/
git remote add origin ~/project-a/
git fetch origin
git merge origin/master --allow-unrelated-histories
git remote rm origin
At this point, the history (i.e. the output of git log
) of project-a
has been merged seamlessly with the existing history in the monorepo. But how do I view the history of project-a
only? i.e. How can I view the history of project-a
as if it had not been merged into the monorepo?
I tried git log -- project-a/
, but that only shows one commit (i.e. 'Move all files into a directory in preparation for conversion to monorepo'
), whereas I had intended to see all the commits I made for the files in project-a
.