I suspect you can do this by moving the path of each and merging one into the other
This assumes it's desirable to add the frontend into the backend repository, though this might not be the case for you - repeat the steps for each if creating a new repository
WARNING I HAVE NOT TESTED THIS YET
Make a backup of your repositories
cp -r project project.bak # FIXME targz
Check out a custom branch (in backend)
(frontend)% git checkout -b custom-move-frontend
(backend)% git checkout -b custom-move-backend
update the remote so they are part of the same repository
get the remote from each
(frontend)% git remote -v # display remote URL
(backend)% git remote -v
update the backend's remote
(backend)% git remote set-url origin "$FRONTEND_REMOTE"
Move the contents of each into its future name
(frontend)% git mv . ./frontend
(frontend)% git add .
(frontend)% git commit -m "MY UPDATE TEXT FRONTEND"
(frontend)% git push # original URL
(backend)% git mv . ./backend
(backend)% git add .
(backend)% git commit -m "MY UPDATE TEXT BACKEND"
(backend)% git push # branch is pushed to frontend's URL
join the unrelated histories
The branches do not share a common history
Git refusing to merge unrelated histories on rebase
(frontend)% git pull
(frontend)% git checkout -b custom-merge-merge # from custom-move-frontend
(frontend)% git merge --allow-unrelated-histories origin/custom-move-backend
the repositories are now merged
extras
I highly recommend adding a file with notes about what happened and at what specific commits
prefixing your commits with a unique string may help you find them later