Git 和 GitHub 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13321556/
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
Difference between Git and GitHub
提问by Luis Andrés García
I have recently added a new project to Git using Eclipse, but do not see the project appear in my GitHub account.
我最近使用 Eclipse 向 Git 添加了一个新项目,但没有看到该项目出现在我的 GitHub 帐户中。
Why do they have the same account information and different repositories?
为什么他们有相同的帐户信息和不同的存储库?
Isn't Git and GitHub the same thing?
Git 和 GitHub 不是一回事吗?
回答by schlicht
Gitis a revision control system, a tool to manage your source code history.
Git是一个版本控制系统,一个管理源代码历史的工具。
GitHubis a hosting service for Git repositories.
GitHub是 Git 存储库的托管服务。
So they are not the same thing: Gitis the tool, GitHubis the service for projects that use Git.
所以它们不是一回事:Git是工具,GitHub是使用 Git 的项目的服务。
To get your code to GitHub, have a look here.
要将您的代码发送到 GitHub,请查看此处。
回答by bakkal
In the SVN analogy, Git replaces SVN, while GitHub replaces SourceForge :P
在 SVN 类比中,Git 替换 SVN,而 GitHub 替换 SourceForge :P
If this project of yours is new, then you can still commit to your local Git, then you can pushto GitHub later on. You will need to add your GitHub repo as a 'remote repository' in your Git setup.
如果你的这个项目是新的,那么你仍然可以提交到你本地的 Git,然后你可以稍后推送到 GitHub。您需要在 Git 设置中将您的 GitHub 存储库添加为“远程存储库”。
They seem to have something for Eclipse users : http://eclipse.github.com/
他们似乎为 Eclipse 用户提供了一些东西:http: //eclipse.github.com/
Otherwise, if you are new to Git : http://git-scm.com/book
否则,如果您是 Git 新手:http: //git-scm.com/book
回答by BugShotGG
What is Git:
什么是Git:
"Git is a free and open source distributed version control systemdesigned to handle everything from small to very large projects with speed and efficiency"
“Git 是一个免费的开源分布式版本控制系统,旨在快速高效地处理从小到大的所有项目”
Git is a distributed peer-peer version control system. Each node in the network is a peer, storing entire repositories which can also act as a multi-node distributed back-ups. There is no specific concept of a central server although nodes can be head-less or 'bare', taking on a role similar to the central server in centralised version control systems.
Git 是一个分布式对等版本控制系统。网络中的每个节点都是一个对等点,存储整个存储库,也可以充当多节点分布式备份。尽管节点可以是无头的或“裸”的,但在集中式版本控制系统中扮演类似于中央服务器的角色,但没有中央服务器的特定概念。
What is GitHub:
什么是GitHub:
"GitHub is a web-basedGit repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features."
“GitHub 是一种基于 Web 的Git 存储库托管服务,它提供Git 的所有分布式修订控制和源代码管理 (SCM) 功能,并添加了自己的功能。”
Github provides access control and several collaboration features such as wikis, task management, and bug tracking and feature requests for every project.
Github 为每个项目提供访问控制和多种协作功能,例如 wiki、任务管理以及错误跟踪和功能请求。
You do not needGitHub to use Git.
您不需要GitHub 即可使用 Git。
GitHub (and any other local, remote or hosted system) can all be peers in the same distributed versioned repositories within a single project.
GitHub(以及任何其他本地、远程或托管系统)都可以是单个项目中相同分布式版本化存储库中的对等体。
Github allows you to:
Github 允许您:
- Share your repositories with others.
- Access other user's repositories.
- Store remote copies of your repositories (github servers) as backup of your local copies.
- 与他人共享您的存储库。
- 访问其他用户的存储库。
- 将您的存储库(github 服务器)的远程副本存储为本地副本的备份。
回答by user2340356
Git — The version control tool that GitHub is built on top of.
Git — GitHub 建立在其之上的版本控制工具。
GitHub — Our company and the name of our software. We build software and websites to help you interact with Git repositories in a nice way.
GitHub——我们的公司和我们软件的名称。我们构建软件和网站来帮助您以一种很好的方式与 Git 存储库交互。
GitHub.com — The website you log into to view repositories online.
GitHub.com — 您登录以在线查看存储库的网站。
GitHub Desktop — An application that you can install on your computer to help you synchronize local code with GitHub.com.
GitHub Desktop — 一个可以安装在计算机上的应用程序,可帮助您将本地代码与 GitHub.com 同步。
source: https://guides.github.com/introduction/getting-your-project-on-github/
来源:https: //guides.github.com/introduction/getting-your-project-on-github/
回答by Cameron McKenzie
There are a number of obvious differences between Git and GitHub.
Git 和 GitHub之间有许多明显的区别。
Git itself is really focused on the essential tasks of version control. It maintains a commit history, it allows you to reverse changes through resetand revertcommands, and it allows you to share code with other developers through push and pull commands. I think those are the essential features every developer wants from a DVCS tool.
Git 本身真正专注于版本控制的基本任务。它维护提交历史,允许您通过重置和恢复命令来撤消更改,并允许您通过推送和拉取命令与其他开发人员共享代码。我认为这些是每个开发人员都希望从 DVCS 工具中获得的基本功能。
No Scope Creep with Git
使用 Git 没有作用域蠕变
But one thing about Gitis that it is really just laser focused on source code control and nothing else. That's awesome, but it also means the tool lacks many features organizations want. For example, there is no built-in user management facilities to authenticate who is connecting and committing code. Integration with things like Jira or Jenkinsare left up to developers to figure out through things like hooks. Basically, there are a load of places where features could be integrated. That's where organizations like GitHub and GitLab come in.
但是关于Git 的一件事是,它实际上只是专注于源代码控制而不是其他任何东西。这很棒,但这也意味着该工具缺乏组织想要的许多功能。例如,没有内置的用户管理工具来验证谁正在连接和提交代码。与 Jira 或Jenkins 之类的集成由开发人员通过钩子之类的东西来解决。基本上,有很多地方可以集成功能。这就是 GitHub 和 GitLab 等组织的用武之地。
Additional GitHub Features
其他 GitHub 功能
GitHub's primary 'value-add' is that it provides a cloud based platform for Git. That in itself is awesome. On top of that, GitHub also offers:
GitHub 的主要“增值”是它为 Git 提供了一个基于云的平台。这本身就很棒。最重要的是,GitHub 还提供:
- simple task tracking
- a GitHub desktop app
- online file editing
- branch protection rules
- pull request features
- organizational tools
- interaction limits for hotheads
- emoji support!!! :octocat: :+1:
- 简单的任务跟踪
- 一个 GitHub 桌面应用程序
- 在线文件编辑
- 分行保护规则
- 拉取请求功能
- 组织工具
- 热心人士的互动限制
- 表情包支持!!!:octocat: :+1:
So GitHub really adds polish and refinement to an already popular DVCS tool.
因此,GitHub 确实对已经流行的 DVCS 工具进行了润色和改进。
Git and GitHub competitors
Git 和 GitHub 的竞争对手
Sometimes when it comes to differentiating between Git and GitHub, I think it's good to look at who they compete against. Git competes on a plane with tools like Mercurial, Subversion and RTC, whereas GitHub is more in the SaaS space competing against cloud vendors such as GitLab and Atlassian's BitBucket.
有时候,当谈到区分 Git 和 GitHub 时,我认为看看他们与谁竞争是很好的。Git 与 Mercurial、Subversion 和 RTC 等工具在平面上展开竞争,而 GitHub 则更多地在 SaaS 领域与 GitLab 和 Atlassian 的 BitBucket 等云供应商竞争。
No GitHub Required
不需要 GitHub
One thing I always like to remind people of is that you don't need GitHub or GitLab or BitBucket to use Git. Git was released in what, 2005? GitHub didn't come on the scene until 2007 or 2008, so big organizations were doing distributed version control with Git long before the cloud hosting vendors came along. So Git is just fine on its own. It doesn't need a cloud hosting service to be effective. But at the same time, having a PaaS provider certainly doesn't hurt.
我总是想提醒人们的一件事是,你不需要 GitHub、GitLab 或 BitBucket 来使用 Git。Git 是在 2005 年发布的?GitHub 直到 2007 年或 2008 年才出现,所以大型组织在云托管供应商出现之前很久就使用 Git 进行分布式版本控制。所以 Git 本身就很好。它不需要云托管服务即可有效。但与此同时,拥有 PaaS 提供商当然不会受到伤害。
Working with GitHub Desktop
使用 GitHub 桌面
By the way, you mentioned the mismatch between the repositories in your GitHub account and the repos you have locally? That's understandable. Until you've connected and done a pull or a fetch, the local Git repo doesn't know about the remote GitHub repo. Having said that, GitHub provides a tool known as the GitHub desktopthat allows you to connect to GitHub from a desktop client and easily load local Git repos to GitHub, or bring GitHub repos onto your local machine.
顺便说一句,您提到了您的 GitHub 帐户中的存储库与您本地拥有的存储库之间的不匹配?这是可以理解的。在您连接并完成拉取或提取之前,本地 Git 存储库不知道远程 GitHub 存储库。话虽如此,GitHub 提供了一个称为GitHub 桌面的工具,它允许您从桌面客户端连接到 GitHub,并轻松地将本地 Git 存储库加载到 GitHub,或将 GitHub 存储库带到您的本地机器上。
I'm not overly impressed by the tool, as once you know Git, these things aren't that hard to do in the Bash shell, but it's an option.
这个工具并没有给我留下太深的印象,因为一旦你了解了 Git,这些事情在 Bash shell 中做起来并不难,但它是一种选择。
回答by Rinoy Ashokan
In simple way we can tell below are the difference between git and git hub and VSTS.
简单地说,我们可以在下面说出 git 和 git hub 和 VSTS 之间的区别。
git: - Treat git as a engine/technology to achieve source version control to our project. Unlike TFS (again a centralized source version control ) git is distributed version control technology. That means git it actually does not mandate to have any server. Through git technology we can make our own local machine as a source code repository not required to have a centralized server always(in large scale it can have Microsoft server to push and keep our project source code). But with SVN and TFS kind version control, it is mandatory that a server be associated with it.
git: - 将 git 视为引擎/技术来实现我们项目的源代码版本控制。与 TFS(同样是集中式源版本控制)不同,git 是分布式版本控制技术。这意味着 git 它实际上并不要求拥有任何服务器。通过git技术,我们可以将自己的本地机器作为源代码存储库,不需要总是有一个中心化的服务器(大规模可以有微软服务器来推送和保存我们的项目源代码)。但是对于 SVN 和 TFS 类型的版本控制,服务器必须与之关联。
For example if I am a free-lance developer and I directly report to my client and there is no other developer involved, I need to keep version control of my code to roll back(any version) and commit my codes and I don't have budget to get a server and I don't have time to install and use other server in my machine as TFS server and TFS client. So, the optimal way is to install git engine and use my local machine as a repository for version controlling by git.
例如,如果我是一名自由职业开发人员并且我直接向我的客户报告并且没有其他开发人员参与,我需要保持我的代码的版本控制以回滚(任何版本)并提交我的代码,而我不需要有购买服务器的预算,但我没有时间在我的机器上安装和使用其他服务器作为 TFS 服务器和 TFS 客户端。所以,最好的方法是安装git引擎并使用我的本地机器作为git版本控制的存储库。
GitHub: - as I said previously git is a technology and used with some command / shell commands , ie git only doesn't have UI. GitHub is online product or online repository which uses git technology for their process and achieve version controls along with other functionalities like bug tracking,Project management, Support ticket management ..etc. In other words Git Hub is a wrapper build on git technology with a UI and other functionalities by other third party firm, it is actually a product owned by somebody or some group based on git technology , where as git is open source, and not marketable product.
GitHub: - 正如我之前所说,git 是一种技术,并与一些命令/shell 命令一起使用,即 git only 没有 UI。GitHub 是在线产品或在线存储库,它使用 git 技术进行流程并实现版本控制以及其他功能,如错误跟踪、项目管理、支持票证管理等。换句话说,Git Hub 是其他第三方公司基于 git 技术构建的具有 UI 和其他功能的包装器,它实际上是基于 git 技术的某人或某个团体拥有的产品,其中 git 是开源的,并且没有市场产品。
VSTS: - VSTS is a Microsoft product for online repository keeping source version control which can be treated as an alternate to git hub. Since its of Microsoft , VSTS support both git technology and TFS(TFVC-team foundation version control). Because TFS is another old Microsoft product to achieve this version control.Gradually I assume VSTS will gradually dump TFS as git is the prominent technology in this area and it is open source.
VSTS: - VSTS 是一种 Microsoft 产品,用于在线存储库保持源版本控制,可以将其视为 git hub 的替代品。自微软以来,VSTS 支持 git 技术和 TFS(TFVC 团队基础版本控制)。因为TFS是另一个微软老产品来实现这种版本控制。渐渐地,我认为VSTS会逐渐转储TFS,因为git是这方面的突出技术,而且它是开源的。
回答by Jeb50
In plain English:
用简单的英语:
- They are all source control as we all know.
- In an analogy, if Git is a standalone computer, then GitHub is a networkof computers connected by web with bells and whistlers.
- So unless you open a GitHub acct and specificallytell VSC or any editor to use GitHub, you'll see your source code up-thereotherwise they are only down here, - your local machine.
- 众所周知,它们都是源代码控制。
- 在一个比喻,如果GIT中是一个独立的计算机,然后GitHub的是一个网络通过与钟声和哨声腹板连接的计算机。
- 因此,除非您打开 GitHub 帐户并特别告诉 VSC 或任何编辑器使用 GitHub,否则您会在上面看到源代码——否则它们只会在下面——您的本地机器。
回答by Ankit Kumar Rajpoot
Git-Git is a version control software that you install on your local system. For an individual working on a project alone, Git proves to be excellent software.
Git-Git是您安装在您的本地系统中的版本控制软件。对于单独从事项目的个人来说,Git 被证明是优秀的软件。
GitHub-As mentioned earlier, Git is a version control system that tracks code changes, while GitHub is a web-based Git version control repository hosting service. It provides all of the distributed version control and source code management (SCM) functionalities of Git while topping it with a few of its own features.
GitHub——如前所述,Git 是一个跟踪代码更改的版本控制系统,而 GitHub 是一个基于 Web 的 Git 版本控制存储库托管服务。它提供了 Git 的所有分布式版本控制和源代码管理 (SCM) 功能,同时还提供了一些自己的功能。
回答by TheFixer
Github is required if you want to collaborate across developers. If you are a single contributor git is enough, make sure you backup your code on regular basis
如果您想跨开发人员协作,则需要 Github。如果你是一个单独的贡献者 git 就足够了,确保你定期备份你的代码