0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GitHubリポジトリの一部を、別のGitHubリポジトリとして独立させる

Last updated at Posted at 2021-05-23

github.com/mrmt/john/doe を github.com/mrmt/doe として切り出して独立させる例

からっぽの github.com/mrmt/doe リポジトリを作っておく

github.com/mrmt/johnをいったんきれいにチェックアウトする

git clone git@github.com:mrmt/john.git

doe以下を別リポジトリとしてpushできる状態に再構成する

cd john
git filter-branch --subdirectory-filter doe HEAD

それを github.com/mrmt/doe にpushする

git remote add tmp git@github.com:mrmt/doe.git
git push tmp

github.com/mrmt/johnにて、doeを掃除する

cd ..

rm -rf john
git clone git@github.com:mrmt/john.git
cd john

git rm -r doe
git commit -a -m 'moved to github.com/mrmt/doe repository'
git push
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?