Help us understand the problem. What is going on with this article?

ロカールgitリポジトリでリモートのリポジトリURL確認方法

More than 1 year has passed since last update.

ロカールにクーロンしたリポジトリのリモートURLを確認する方法はいくつあります。

リポジトリ例: 
$ git clone git@github.com:ruby/ruby.git ruby
$ cd ruby

方法1

$ git config --get remote.origin.url
git@github.com:ruby/ruby.git

方法2

$ git remote -v
origin  git@github.com:ruby/ruby.git (fetch)
origin  git@github.com:ruby/ruby.git (push)

方法3

$ git remote show -n origin
* remote origin
  Fetch URL: git@github.com:ruby/ruby.git
  Push  URL: git@github.com:ruby/ruby.git
  HEAD branch: (not queried)
  Local ref configured for 'git push' (status not queried):
    (matching) pushes to (matching)

方法4

$ git remote show origin
* remote origin
  Fetch URL: git@github.com:ruby/ruby.git
  Push  URL: git@github.com:ruby/ruby.git
  HEAD branch: trunk
  Remote branches:
    ruby_1_3   new (next fetch will store in remotes/origin)
    ruby_1_4   new (next fetch will store in remotes/origin)
....

方法5

$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = git@github.com:ruby/ruby.git

方法6

$ git config -l
...
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:ruby/ruby.git

なお、git helpを活用すれば、何でも調査できる。例

$ git remote show --help
usage: git remote show [<options>] <name>

    -n                    do not query remotes

参照

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away