git,

List remotes with git remote

Sep 27, 2022 · 1 min read · Post a comment

Remotes as part of a Git repository point to the remote repo URLs. On your local machine these are known as origin. By default, each repo has a single remote, although in some scenarios that might not be the case. I haven’t seen one yet, but if you do, please let me know.

Prerequisites

  • Git

Solution

To get the remotes name, run:

git remote show

Output:

origin

This command doesn’t show much, so if you want to see where this origin points to, use:

git remote -v

Output:

origin  https://<git_username>:<git_secret>@<repo_url> (fetch)
origin  https://<git_username>:<git_secret>@<repo_url> (push)

Conclusion

To find more neat Git commands and hacks, simply browse the Git category. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.

git