リポジトリの新しいクローンを作成した� �合でも、フォルダを別のリポジトリに分割したとき、Git の履歴や変更を失うことはありません。
- 
ターミナルターミナルGit Bashを開いてく� さい。 
- 
現在のワーキングディレクトリを、新しいリポジトリを作成したい� �所に変更します。 
- 
サブフォルダのあるリポジトリをクローンします。 $ git clone https://hostname/USERNAME/REPOSITORY-NAME
- 
ワーキングディレクトリをクローンしたリポジトリに変更します。 $ cd REPOSITORY-NAME
- 
To filter out the subfolder from the rest of the files in the repository, run git filter-repo, supplying this information:- FOLDER-NAME: The folder within your project where you'd like to create a separate repository.
 ヒント: Windows ユーザは、 フォルダを区切るために、 /を使ってく� さい。$ git filter-repo --path FOLDER-NAME1/ --path FOLDER-NAME2/ # Filter the specified branch in your directory and remove empty commits > Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (89/89) > Ref 'refs/heads/BRANCH-NAME' was rewrittenThe repository should now only contain the files that were in your subfolder(s). 
- 
GitHub Enterprise Server 上で新しいリポジトリを作成します。 
- 
At the top of your new repository on GitHub Enterprise Serverインスタンス's Quick Setup page, click to copy the remote repository URL.  Tip: For information on the difference between HTTPS and SSH URLs, see "About remote repositories." 
- 
リポジトリの既存のリモート名を確認します。 originやupstreamがよく使われます。$ git remote -v > origin https://hostname/USERNAME/REPOSITORY-NAME.git (fetch) > origin https://hostname/USERNAME/REPOSITORY-NAME.git (push)
- 
既存のリモート名およびステップ 7 でコピーしたリモートリポジトリ URL を使って、新しいリポジトリの新しいリモート URL をセットアップします。 git remote set-url origin https://hostname/USERNAME/NEW-REPOSITORY-NAME.git
- 
新しいリポジトリの名前を使い、リモート URL が変更されたことを確認します。 $ git remote -v # Verify new remote URL > origin https://hostname/USERNAME/NEW-REPOSITORY-NAME.git (fetch) > origin https://hostname/USERNAME/NEW-REPOSITORY-NAME.git (push)
- 
変更を GitHub Enterprise Server の新しいリポジトリにプッシュします。 git push -u origin BRANCH-NAME