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 5 years have passed since last update.

複数のリポジトリを一つにまとめるコマンド

0
Posted at

自分用メモ

こちらを参考にさせていただいてます.

cd til

# bash
ACCOUNT=hppRC
REPO=XXXXX

# fish
set ACCOUNT hppRC
set REPO XXXXX

# at dest repository path
git remote add $REPO git@github.com:$ACCOUNT/$REPO.git
git fetch $REPO
git checkout -b $REPO $REPO/master
git filter-branch -f --tree-filter "mkdir __temp__ && git mv -k {,.[!.],..[!.]}* __temp__/ && mkdir $REPO && git mv -k __temp__/{,.[!.],..[!.]}* $REPO/"
git checkout master
git merge $REPO --allow-unrelated-histories -m "merge to til"
# 初回のみ
# ARCHIVE=til
# githubでtilというリポジトリを作成
# git remote add origin git@github.com:$ACCOUNT/$ARCHIVE.git
git push
自分用
# tilディレクトリで
set ACCOUNT hppRC
set REPO XXXXX

git remote add $REPO git@github.com:$ACCOUNT/$REPO.git
git fetch $REPO
git checkout -b $REPO $REPO/master
git filter-branch -f --tree-filter "mkdir __temp__ && git mv -k {,.[!.],..[!.]}* __temp__/ && mkdir $REPO && git mv -k __temp__/{,.[!.],..[!.]}* $REPO/"
git checkout master
git merge $REPO --allow-unrelated-histories -m "merge to til"
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?