DEV Community

Cover image for How to see remote url in git
Adrian Matei for Codever

Posted on • Edited on • Originally published at codever.dev

How to see remote url in git

The simplest way:

git remote -v

# result similar to the following
origin  git@github.com:codeverland/codever.git (fetch)
origin  git@github.com:codeverland/codever.git (push)
Enter fullscreen mode Exit fullscreen mode

To get only the remote URL:

git config --get remote.origin.url

# result similar to the following
git@github.com:codeverland/codever.git
Enter fullscreen mode Exit fullscreen mode

In order to get more details about a particular remote, use the git remote show [remote-name] command

git remote show origin # here "origin" is the remote name

# result similar to the following
* remote origin
  Fetch URL: git@github.com:codeverland/codever.git
  Push  URL: git@github.com:codeverland/codever.git
  HEAD branch: master
  Remote branches:
    dependabot/npm_and_yarn/backend/aws-sdk-2.814.0  new (next fetch will store in remotes/origin)
    dependabot/npm_and_yarn/backend/nth-check-2.0.1  new (next fetch will store in remotes/origin)
    dependabot/npm_and_yarn/backend/path-parse-1.0.7 new (next fetch will store in remotes/origin)
    dependabot/npm_and_yarn/path-parse-1.0.7         new (next fetch will store in remotes/origin)
    docs/add-links-to-vscode                         tracked
    feat/add-last-searches-to-side-menu              tracked
    feat/add-welcome-info                            tracked
    feat/migrate-to-codever                          tracked
    master                                           tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local refs configured for 'git push':
    docs/add-links-to-vscode            pushes to docs/add-links-to-vscode            (local out of date)
    feat/add-last-searches-to-side-menu pushes to feat/add-last-searches-to-side-menu (local out of date)
    feat/add-welcome-info               pushes to feat/add-welcome-info               (local out of date)
    feat/migrate-to-codever             pushes to feat/migrate-to-codever             (local out of date)
    master                              pushes to master                              (up to date)

Enter fullscreen mode Exit fullscreen mode

Shared with ❤️ from Codever. 👉 use the copy to mine functionality to add it to your personal snippets collection.

Top comments (0)