1
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上に新しいリポジトリを作成した後、古いリポジトリのgit履歴を新しいリポジトリへpushする

Posted at

github上に新しいリポジトリを作成した後、古いリポジトリのgit履歴を新しいリポジトリへpushする際のメモ

1.新しいリポジトリを作成する
2.古いリポジトリのgit履歴を新しいリポジトリへpushする

1.新しいリポジトリを作成する

githubのrepository-->newから新しい空のリポジトリを作成する

sampleという名前の空リポジトリを作成する例

スクリーンショット 2021-12-26 21.53.25.png

2.古いリポジトリのgit履歴を新しいリポジトリへpushする

old_sampleという古いリポジトリから、新しいリポジトリsampleへpushするコマンド例
URLは適宜変更すればOK

git clone http://github.com/seigot/old_sample
cd old_sample
git push --mirror http://github.com/seigot/sample

新しいリポジトリに期待通りpushできている事を確認した後、古いリポジトリは不要であれば削除すればOK

参考

1
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
1
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?