今まで自分がアクセスしていたリモートリポジトリを調べて、それで他の人に git clone していただきたいですの。
または、別の端末で続きを進めることになったため、今作業中のプロジェクトのリモート URL を調べておきたいですわ。
普段は origin で済ますことができたるため、URL をよく忘れてしまいますの><。
コマンドまとめ
# リモートリポジトリ名の一覧 git remote show # リモートリポジトリの詳細 git remote show <remoterepository> # リモートリポジトリをクローン git clone <repositoryurl>
実践
リモートリポジトリの URL を調べる
$ git remote show
origin
$ git remote show origin
* remote origin
Fetch URL: http://111.11.1.1/git/SampleProject
Push URL: http://111.11.1.1/git/SampleProject
HEAD branch: master
Remote branches:
feature1 tracked
master tracked
Local branches configured for 'git pull':
feature1 merges with remote master
master merges with remote master
Local refs configured for 'git push':
feature1 pushes to feature1 (up to date)
master pushes to master (fast-forwardable)
プロジェクトをクローンする
$ git clone http://111.11.1.1/git/SampleProject Cloning into SampleProject ... remote: Counting objects: 269, done. remote: Compressing objects: 100% (217/217), done. remote: Total 269 (delta 133), reused 114 (delta 42) Receiving objects: 100% (269/269), 858.23 KiB | 0 bytes/s, done. Resolving deltas: 100% (133/133), done. Checking connectivity... done. $ cd SampleProject/
おわりに
次のページが参考になりました。ありがとう存じます!
以上です。
