Reputation: 1251
I'm cloning a repo using git clone --recursive [email protected]:name1/name2.git
, where name1
and name2
are specific to the project. I want to understand the meaning of each part of the string [email protected]:name1/name2.git
. Specifically:
What is [email protected]
?
What is name1
?
What is name2.git
?
Upvotes: 1
Views: 2610
Reputation: 76784
This is an SSH location. You could also write this as a URL as ssh://[email protected]/name1/name2.git
.
The git
portion is the username, github.com
is the host to which you're connecting, and name1/name2.git
is the path component denoting the repository location, which is passed to the git-upload-pack
or git-receive-pack
command that's on the remote server.
In GitHub's case, the name1
portion is the owner of the repository and the name2
portion is the name of the repository, but Git SSH locations in general need not follow this form.
The .git
portion on the end is optional and typically denotes that the remote location is a bare Git repository; Git will attempt to add it automatically if it's needed but you don't specify it.
Upvotes: 2