git 项目与存储库,根本区别是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5043306/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 10:08:09  来源:igfitidea点击:

git project vs repository, what's the fundamental difference?

gitrepositoryprojectgitorious

提问by zcourts

I have two projects that currently use SVN and I'm migrating to git, I signed up to gitorious and there's the option to create a new project or add a repository. I'm just starting out with git so I don't know what the difference is, or rather what it means if I simply use to repositories under one project. If i do that I'll end up with theirDomain.com/myname/repository1 and theirDomain.com/myname/repository2

我有两个当前使用 SVN 的项目,我正在迁移到 git,我注册了 gitorious 并且可以选择创建一个新项目或添加一个存储库。我刚开始使用 git,所以我不知道有什么区别,或者更确切地说,如果我只是使用一个项目下的存储库,这意味着什么。如果我这样做,我最终会得到 theirDomain.com/myname/repository1 和 theirDomain.com/myname/repository2

If I choose to create two projects then I end up with theirDomain.com/project1 theirDomain.com/project2

如果我选择创建两个项目,那么我最终会得到 theirDomain.com/project1 theirDomain.com/project2

Apart from the URL difference, will there be any implications in choosing one over the other? thanks in advance

除了 URL 差异之外,选择一个而不是另一个会有任何影响吗?提前致谢

采纳答案by Marc Hughes

That is a gitorious, not a git thing. You can have multiple repositories per project.

这是一个 gitorious,而不是一个 git 的东西。每个项目可以有多个存储库。

For instance, if you have a client/server application. You could have one project, and a repository for the client and a repo for the server inside it.

例如,如果您有一个客户端/服务器应用程序。你可以有一个项目,一个客户端存储库和一个服务器存储库。

回答by Ltf4an

With respect to the underlying git system itself and loose terms, a git repo is the .git dir. A git project is the parent dir containing the .git dir; the parent dir also serves as the 'working directory."

关于底层 git 系统本身和宽松的术语,git repo 是 .git 目录。一个 git 项目是包含 .git 目录的父目录;父目录也用作“工作目录”。

Three main sections of a Git project

Git 项目的三个主要部分

  1. Git directory, .git (also known as repository)
  2. Working area/directory
  3. Staging area (the index)
  1. Git 目录,.git(也称为存储库)
  2. 工作区/目录
  3. 集结区(索引)

回答by Htbaa

Git has no such things as projects, only repositories. These projects are nothing more but a feature of Gitorious as it seems to me.

Git 没有诸如项目之类的东西,只有存储库。在我看来,这些项目只不过是 Gitorious 的一个功能。

回答by Alex

It is just like if you use sourceforge, googlecode, redmine, trac or whatever: you have the repo where your actual code is, and then you have a broader project that includes your repo, but also has things like an issue tracker, maybe a wiki, etc....

就像你使用 sourceforge、googlecode、redmine、trac 或其他任何东西一样:你有你的实际代码所在的 repo,然后你有一个更广泛的项目,包括你的 repo,但也有诸如问题跟踪器之类的东西,也许是一个维基等……

It is all the other stuff that relates to your code, but isn't actually source code.

它是与您的代码相关的所有其他内容,但实际上并不是源代码。