diff --git a/content/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository.md b/content/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository.md index 7d320ebb0d..5e1281b5da 100644 --- a/content/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository.md +++ b/content/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository.md @@ -55,12 +55,17 @@ If you create a new clone of the repository, you won't lose any of your Git hist ```shell $ git filter-repo --path FOLDER-NAME/ # Filter the specified branch in your directory and remove empty commits - > Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (89/89) - > Ref 'refs/heads/BRANCH-NAME' was rewritten ``` The repository should now only contain the files that were in your subfolder(s). + If you want one specific subfolder to be the new root folder of the new repository, you can use the following command: + + ```shell + $ git filter-repo --subdirectory-filter FOLDER-NAME + # Filter the specific branch by using a single sub-directory as the root for the new repository + ``` + 1. [Create a new repository](/repositories/creating-and-managing-repositories/creating-a-new-repository) on {% data variables.product.product_name %}. 1. At the top of your new repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}'s Quick Setup page, click {% octicon "copy" aria-label="Copy to clipboard" %} to copy the remote repository URL.