定义遥控器时,Git存储库的真实名称是什么? [英] What is a Git repository's real name when defining a remote?

查看:35
本文介绍了定义遥控器时,Git存储库的真实名称是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接受一个名为 myrepo 的Git存储库.将其称为远程名称时,它的真实名称/文件名是什么?

Take a Git repo named myrepo. What is it's real name/filename when referring to it as a remote?

我问是因为我注意到,对于Github,您可以使用以下任一方法:

I ask because I've noticed that for Github you can use either:

  • https://github.com/lightcc/myrepo
  • https://github.com/lightcc/myrepo.git

我还看到了本地存储库直接指向 .git 文件夹的情况:

I've also seen cases where local repos point directly to the .git folder:

  • /c/code/myrepo/.git

在其他情况下,通过repo文件夹名称在本地调用repo,例如 myrepo.git ,例如:

And other cases where the repo is locally called by the repo folder name like myrepo.git, such as:

  • /c/code/myrepo.git

最后一个可能是-bare 存储库的真实文件夹名称,但是我不确定,我之前没有创建本地裸存储库.

That last one might be the real folder name for a --bare repo, but I'm not sure, I haven't created a local bare repo before.

更新了问题,因为答案不是我所期望的-我试图了解如何将存储库设置为远程存储,甚至正确设置本地存储库以使其成为未来的遥控器.因此,这与 git remote add 命令语法有关.我得到的是英文,我们只是说它叫 myrepo .

Updated question as the answers weren't what I expected - I am trying to understand how to setup a repo as a remote, or even setup a local repo properly so that it can become a remote in the future. So this has more to do with the git remote add command syntax. I get that in English we would just say it is named myrepo.

推荐答案

这取决于服务器.

GitHub和其他人会将非 .git 版本的别名命名为 .git .

GitHub and others will alias the non-.git version to .git.

如果您正在运行自己的Git服务器,并使用 .git 命名裸存储库(建议使用裸存储库),那么您将需要使用 .git .

If you're running your own Git server, and name the bare repository with .git (as recommended for bare repos), then you will be required to use .git.

这篇关于定义遥控器时,Git存储库的真实名称是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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