讯享网
Have you been told to “clone the repo and build it,” and don’t know what to do next? We’ll show you how to get that program on GitHub running on Linux, even if you’re a beginner.
您是否被告知要“克隆存储库并构建它”,并且不知道下一步该怎么做? 即使您是初学者,我们也会向您展示如何在Linux上的GitHub上获取该程序。
The instructions that make up a computer program are written, edited, and saved in text files. A program called a compiler then processes these files. This produces the executable version of the program. The text files of instructions are called the source code. The version of the program that can actually run on a computer is called the binary or the executable.
组成计算机程序的指令被编写,编辑并保存在文本文件中。 然后,称为编译器的程序将处理这些文件。 这将生成程序的可执行版本 。 指令的文本文件称为源代码。 实际上可以在计算机上运行的程序的版本称为二进制文件或可执行文件。
That’s a simplified version of events, but it paints a correct—if generalized—picture. In practice, you’ll find all sorts of variations on that model. Sometimes, other programs generate the text files. Other times, the source code runs inside an interpreter and doesn’t need to be compiled, and so on.
那是事件的简化版本,但是它描绘了正确的(如果是概括的)画面。 在实践中,您会在该模型上找到各种变化。 有时,其他程序会生成文本文件。 有时,源代码在解释器中运行,不需要编译,依此类推。
However, the one universal truth across all software projects is this: the source code files are the crown jewels, and they need to be looked after just as carefully.
但是,所有软件项目的一个普遍真理是:源代码文件是头等大事,需要同样谨慎地对待它们。
版本控制程序 (Version Control Programs)
All of the source code files within a project are called the codebase. Large projects often have many developers working on the codebase. Every code change must be tracked and identifiable. If required, the changes must be reversible. If different developers make changes to the same source code file, their edits must be merged.
项目中的所有源代码文件都称为代码库。 大型项目通常有许多开发人员在代码库上工作。 每个代码更改都必须得到跟踪和识别。 如果需要,更改必须是可逆的。 如果不同的开发人员对同一源代码文件进行了更改,则必须合并他们的编辑。
It’s not surprising, then, that software programs called version control systems exist to make the management of changes to the codebase easier. Version control systems hold all previous versions of each file in the codebase, and every change is recorded, commented on, and tracked.
因此,毫不奇怪的是,存在称为版本控制系统的软件程序,可以简化对代码库的更改的管理。 版本控制系统在代码库中保存每个文件的所有先前版本,并且记录,注释和跟踪每个更改。
一个叫做Git的小东西 (A Little Thing Called Git)
Linus Torvalds, the creator of the Linux kernel, developed a version control program called Git to administer the Linux kernel codebase. It’s now the world’s most widely adopted version control software. There are millions of people using it—literally.
Linux内核的创建者 Linus Torvalds开发了一个名为Git的版本控制程序来管理Linux内核代码库。 它现在是世界上使用最广泛的版本控制软件。 从字面上看,有数百万人在使用它。
With Git, a project’s codebase is stored in repositories. In addition to the local repositories that sit on developer’s computers and, perhaps, on a central server on the network, it’s a good practice to have an off-site, or remote, repository.
使用Git,项目的代码库存储在存储库中 。 除了位于开发人员的计算机上的本地存储库,或者也许位于网络中央服务器上的本地存储库,还有一个不错的做法是拥有一个异地或远程存储库。
And that’s where GitHub comes in.

这就是GitHub出现的地方。
的GitHub (GitHub)
GitHub was created as a result of git‘s success. The founders saw the emerging need for securely hosted remote git repositories. They launched a business providing a cloud platform to allow development teams to host remote repositories. As of April 2019, GitHub hosts over 100 million repositories.
GitHub是git成功的结果。 创始人看到了对安全托管的远程git存储库的新兴需求。 他们启动了提供云平台的业务,以允许开发团队托管远程存储库。 截至2019年4月,GitHub托管了超过1亿个存储库。
If an application is an open-source project, the chances are very high that it will be hosted on GitHub. There are other repository platforms available, such as BitBucket and GitLab, but GitHub has the lion’s share of open source repositories.
如果应用程序是一个开源项目,那么将其托管在GitHub上的可能性很高。 还有其他可用的存储库平台,例如BitBucket和GitLab ,但是GitHub在开源存储库中占有最大份额。
仓库的剖析 (Anatomy of a Repository)
A GitHub repository is comprised of folders containing files such as the all-important source code files. Usually, there are many other types of files in the repository. There might be documentation files, man pages, software license files, build instructions and shell script files. There are no rules regarding what a repository should or must contain, but there are conventions.
GitHub存储库由包含所有重要源代码文件之类的文件的文件夹组成。 通常,存储库中还有许多其他类型的文件。 可能有文档文件,手册页,软件许可证文件,构建说明和Shell脚本文件。 对于存储库应包含或必须包含的内容,没有任何规则,但是有约定。
If you know your way around one kitchen, you can navigate any kitchen. It’s the same with repositories. Once you understand the conventions, you know where to go to find what you need.
如果您知道围绕一个厨房的方式,则可以导航任何一个厨房。 存储库也是如此。 了解约定后,您便知道去哪里可以找到所需的内容。
So, how do you get a copy of the repository on your computer, and how do you build the program into a binary executable?
因此,如何在计算机上获取存储库的副本,以及如何将程序构建为二进制可执行文件?
自述文件 (The readme File)
It’s traditional to include a readme file in a repository. It might be called readme, Readme, or README. It might have an extension of “.md” or no extension at all.
传统上是在存储库中包含自述文件。 它可能称为自述文件,自述文件或自述文件。 它的扩展名可能是“ .md”或根本没有扩展名。
Let’s have a look at the GitHub repository for the Atom editor. You see a long list of folders and files. Scroll down, and you see the contents of the README.md file.
让我们看一下Atom编辑器的GitHub 存储库 。 您会看到一长串的文件夹和文件。 向下滚动,您会看到README.md文件的内容。
GitHub automatically puts the contents of the readme file on the front page of the repository. If the readme file has a “.md” extension, it will contain Markdown markup language. This allows the developers to use style elements, such as fonts, bullet points, and images.
GitHub自动将自述文件的内容放在存储库的首页上。 如果自述文件的扩展名为“ .md”,则它将包含Markdown标记语言。 这使开发人员可以使用样式元素,例如字体,项目符号和图像。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/58353.html