Skip to content

Instantly share code, notes, and snippets.

@donchan922
Last active December 12, 2019 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/f2604d99eb4f7afed6068f6b3dddd896 to your computer and use it in GitHub Desktop.
Save donchan922/f2604d99eb4f7afed6068f6b3dddd896 to your computer and use it in GitHub Desktop.
# 古いリポジトリ: old-repository
# 新しいリポジトリ: new-repository
# 古いリポジトリをクローンする
$ git clone https://github.com/donchan922/old-repository.git
$ cd old-repository
# 古いリポジトリのコミット履歴を確認する(新しいリポジトリにコミット履歴は引き継がない)
$ git log --oneline
f67d177 (HEAD -> master, origin/master, origin/HEAD) third commit
8c0864b second commit
56f1635 Initial commit
# 古いリポジトリのGitの更新情報を削除する
$ rm -rf .git
# 新しいリポジトリを新規作成する
$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin https://github.com/donchan922/new-repository.git
# 新しいリポジトリのコミット履歴を確認する(古いリポジトリのコミット履歴を引き継いでいない)
$ git log --oneline
c27e612 (HEAD -> master, origin/master) Initial commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment