git remote

リモートリポジトリの追加、削除、表示を行うコマンド

リモートリポジトリを一覧表示する。

1$ git remote -v
shell

originの詳細を表示する

1$ git remote show origin
shell

originという名前でリモートリポジトリへの参照を追加するなら

1$ git remote add origin https://xxx.xxx/xxx/xxx.git
shell

originと名付けたリモートリポジトリーの参照を削除するなら

1$ git remote rm origin
shell

originoriginalに変更する

1$ git remote rename origin original
shell

Git Hub でリポジトリを作成、それをgit cloneしたときは、以下のコマンドが実行されているのと同じ。

1$ mkdir project
2$ cd project
3$ git init
4$ git remote add -f -t main origin git://github.com/xxx/xxx.git/
5$ git merge origin
shell