Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of the colon in this git repository url?

Tags:

git

colon

Please pardon my ignorance; I'm new to Git and not sure where better to look for an answer, but what's the purpose of the colon after 'example.com' in the following url (which points to a git repository on my mediatemple server)?

git remote add repo_name ssh://serveradmin%[email protected]:/home/45678/domains/git.example.com/html/example.git

like image 459
David Rhoden Avatar asked Mar 11 '11 23:03

David Rhoden


People also ask

What is the URL of my git repository?

The Git URL will be inside the Git configuration file. The value corresponds to the key url . For Windows open the below file in any text editor and find the value for key url . Note: This will work even if you are offline or the remote git server has been taken down.

What is the purpose of a git repository?

A Git repository tracks and saves the history of all changes made to the files in a Git project. It saves this data in a directory called . git , also known as the repository folder. Git uses a version control system to track all changes made to the project and save them in the repository.

What is git remote set URL?

The git remote set-url command changes the Git remote associated with a repository. This command accepts the name of the remote (which is usually “origin”) and the new remote URL to which you want the repository to point.

What is meant by GitHub URL?

GitHub URL is defined as a mechanism that is exploited by the browsers for the retrieval of published resources on GitHub. URL is an acronym for Uniform Resource locator, and with the advent of hypertext, HTTP, HTTPS URL has been treated as a key concept in the retrieval process on the web.


2 Answers

This syntax is actually wrong, but it's a bit like the scp-style syntax that you can use in git URLs, where it separates the hostname from the path on that host. Your options for specifying git URLs are listed in the git clone documentation. In your case you probably want one of the following instead:

 serveradmin%[email protected]:/home/45678/domains/git.example.com/html/example.git

... or:

 ssh://serveradmin%[email protected]/home/45678/domains/git.example.com/html/example.git

In either case, the username is serveradmin%example.com, the hostname is example.com and the path on that host is /home/45678/domains/git.example.com/html/example.git.

like image 179
Mark Longair Avatar answered Sep 28 '22 23:09

Mark Longair


It separates the hostname (of the server)from the path (to the repo) as explained here

like image 26
objects Avatar answered Sep 29 '22 00:09

objects