LoginSignup
5
0

More than 1 year has passed since last update.

【Git】git cloneして別のリポジトリにpushする

Posted at

別名でgit clone

元のリポジトリ名とは別名でgit cloneします。

ターミナル
$ git clone git@github.com:ユーザー名/リポジトリ名.git 別名

新リポジトリを作成する

新しいリポジトリを作成します。
作成方法については以下のページをご参照ください。

remote urlを変更

以下のコマンドでリモートリポジトリを変更します。

ターミナル
$ cd $_

$ git config remote.origin.url
git@github.com:旧ユーザー名/旧リポジトリ名.git

$ git remote set-url origin git@github.com:新ユーザー名/新リポジトリ名.git

$ git config remote.origin.url
git@github.com:新ユーザー名/新リポジトリ名.git

2回目のgit config remote.origin.urlで新しいリポジトリの情報が表示されることを確認します。
表示されていればあとは通常通りpushするだけです。

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