What use is the *.git extension when cloning a git

2019-06-04 08:03发布

问题:

Commonly seen on GitHub and here on SO (Import existing source code to GitHub):

git@github.com:/youruser/somename.git vs git@github.com:/youruser/somename

I accidentally added a git remote without the *.git extension and it worked fine. I only noticed it after pushing up a new branch.

Is there any need for the *.git extension?

回答1:

No, you can skip the .git: the git repository hosting service (here GitHub, but you would find the same with gitolite, GitLab or Gitorious) usually knows how to find the full repository path from its name alone (without '.git')



标签: git github ssh