LoginSignup
71

More than 5 years have passed since last update.

forkしたpublicリポジトリをprivateにする

Posted at

forkしたpublicリポジトリをprivateにする

  • 公開されているリポジトリをフォークして、個人のprivateリポジトリにしたかった。
  • githubのfork機能を使うと、公開リポジトリになりprivateに変更できない。
  • わからんので調べた。

# bareモードでクローンする
git clone --bare https://github.com/hoge/hoge
# クローンした階層にいく
cd hoge.git
# ここでgithub上のprivateリポジトリを作成しておく
# 作成したリポジトリにmirrorでpushする
git push --mirror git@github.com:yourname/yourrepo
# bareモードでクローンした不要な階層を削除しておく
cd ../
rm -rf hoge.git

以上、あざした!!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
71