FreeKB - Git (Version Control) git remote command
Git (Version Control) - git remote command

This assumes you are already cloned a repository from the source Git repo (typically called "origin") to a directory on your PC, such as the foo.git or bar.git repos.

 

The git remote command can be used to view the shorthand name of the repository that you have cloned.

git remote

 

Typically, the shorthand name of the source Git repository is "origin".

origin

 

The -v or --verbose flag can be used to include the full URL to the remote Git repository.

git remote --verbose

 

Which will return something like this.

origin  ssh://git@example.com:7999/path/to/example.git (fetch)
origin  ssh://git@example.com:7999/path/to/example.git (push)

 

The git remote show command will display even more details.

git remote show origin

 

Like this.

* remote origin
  Fetch URL: ssh://git@example.com:7999/midengops/example.git
  Push  URL: ssh://git@example.com:7999/midengops/example.git
  HEAD branch: master
  Remote branches:
    develop tracked
    master  tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter e97f4 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |