From 5154f938da4042985ac02b28924a9e4f8af4c9d1 Mon Sep 17 00:00:00 2001 From: groninge Date: Tue, 10 Sep 2024 08:41:01 +0200 Subject: [PATCH] Update preserving-git-histories.md --- docs/shared/migration/preserving-git-histories.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/shared/migration/preserving-git-histories.md b/docs/shared/migration/preserving-git-histories.md index 4d7ab1e71ff67..e908cb4023bf5 100644 --- a/docs/shared/migration/preserving-git-histories.md +++ b/docs/shared/migration/preserving-git-histories.md @@ -16,12 +16,18 @@ In order to avoid merge conflicts later, it's best to first do the folder reorga ```shell cd my-standalone-app +git checkout main git fetch -git checkout -b monorepo-migration origin/master +git checkout -b monorepo-migration main mkdir -p apps/my-standalone-app git ls-files | sed 's!/.*!!'| uniq | xargs -i git mv {} apps/my-standalone-app +``` +Check if you need to move back the `.gitignore` file to the root and/or update any paths so you don't commit previously ignored files/folders. +If all is well proceed with the commit and push. + +```shell git commit -m "Move files in preparation for monorepo migration" -git push -u +git push --set-upstream origin monorepo-migration ``` Next, in your monorepo, we'll add a remote repository url for where the standalone app is located: