1
1

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.

GotHubでローカルリポジトリとリモートリポジトリを紐付け

Posted at

Githubでリモートリポジトリを作成する

https://github.com/new
Create a new repositoryを選択でも良い

・任意のリポジトリ名
・public / private どちらでも可
・readme ナシ、.gitignore ナシ、license ナシ
※readmeをつけると後々競合する可能性がある??

リモートリポジトリの確認

$ git remote -v

何も表示されなければ紐づいてない
表示されると紐づいている

リモートリポジトリの解除

$ git remote -v
以下が表示される
origin	https://github.com/github名/リモートリポジトリ名.git 

上記をコピー(デフォルトではorigin)

$ git remote remove リモートリポジトリ名(デフォルトだとorigin)

を実行する

$ git remote -v

を再度実行し、何も表示されなければ紐付け解除成功!

クローンアドレスをコピー

$ git remote add origin コピーしたクローンアドレス
$ git remote -v

を実行し、origin git@github.com:github名/アプリ名.git (fetch)のように紐づいていることを確認する。

参考
https://hsmtweb.com/tool-service/git-local-remote.html
https://qiita.com/miriwo/items/4fdb5c9371693b70e123

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?