1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Update splitting-a-subfolder-out-into-a-new-repository.md, adding com… (#29640)

Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
This commit is contained in:
Riccardo Förster
2023-11-02 15:26:41 +01:00
committed by GitHub
parent fbeb0cd127
commit 2b51f70300

View File

@@ -55,12 +55,17 @@ If you create a new clone of the repository, you won't lose any of your Git hist
```shell ```shell
$ git filter-repo --path FOLDER-NAME/ $ git filter-repo --path FOLDER-NAME/
# Filter the specified branch in your directory and remove empty commits # 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). 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. [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. 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.