Git既存のリポジトリから新規リポジトリを複製したい
現在あるGithubのGitリポジトリをベースとして新規でプログラムを作りたいときの方法
Githubで新規でリポジトリを作成
git clone を利用して既存Gitリポジトリを取得する
取得したGitリポジトリの.gitフォルダを削除する
git init で再度 リポジトリとして作成
git addを行いその後にコミット、git remoteで新規で作成したリポジトリを指定する。
プッシュする
リポジトリの履歴を残したい場合は以下のように
git clone --mirror [email protected]:a.git hoge //既存リポジトリ
cd hoge/
git remote set-url origin [email protected]:b.git //新規リポジトリ
git push --mirror origin
https://teratail.com/questions/31714
タグ: Git