从SSH中克隆git仓库时,* .git扩展名有什么用? [英] What use is the *.git extension when cloning a git repo from SSH?

查看:155
本文介绍了从SSH中克隆git仓库时,* .git扩展名有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

常见于GitHub和SO(导入现有源代码到GitHub ):

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



我不小心加了一个git远程没有* .git扩展名,它工作正常。我推荐一个新的分支后才注意到它。



是否需要* .git扩展?

.git :git仓库托管服务(这里是GitHub,但您会发现相同的gitolite,GitLab或Gitorious)通常知道如何从它的名字中找到完整的存储路径(没有' .git ')


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?

解决方案

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')

这篇关于从SSH中克隆git仓库时,* .git扩展名有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆