I am trying to migrate to a monorepo keeping the history, after some research, looks like the ideal tool is git subtree.
I think I misunderstood something about git subtree, I hope any of you could help me.
I am trying to run the following command:
git subtree add -P ./backend/auth git@github.com:<project>/<repo>.git master
however, I keep bumping in invalid paths, after each error I was trying to delete and commit the file removal in order to try to solve, maybe it was because it woudn't accept some sort of files...
error: invalid path './backend/auth/.env.ref'
error: invalid path './backend/auth/.github/workflows/dev.yml'
error: invalid path './backend/auth/.gitignore'
error: invalid path './backend/auth/.npmignore'
error: invalid path './backend/auth/.npmrc'
error: invalid path './backend/auth/.nvmrc'
error: invalid path './backend/auth/.vscode/launch.json'
error: invalid path './backend/auth/README.md'
After README.md path returned an error I gave up and decided to ask a question here.
Does anyone knows what can be happening?
Right now my monorepo it´s pretty initial and looks like the following
├── backend
├── frontend
├── infra
├── readme.md
└── tools
└── libs
I think you just have to remove the leading ./
:
git subtree add -P backend/auth git@github.com:<project>/<repo>.git master