如何查看和编辑开源应用程序的源代码

虽然开源是一个不错的选择,但您还需要投资于合适的社区。 GitHub是执行此操作的最佳场所之一,不仅因为访问该站点的用户数量众多,还因为GitHub提供的功能。如果您在GitHub上找到一个开源应用程序,我将向您展示一些可以使用它的功能,包括查看,编辑和分叉代码。

创建帐户

在开始使用GitHub之前,最好先使用它们创建一个帐户。创建帐户是免费的,并且可以让您利用分叉等众多功能。 GitHub除了免费会员外还具有不同的会员级别,但是免费帐户对于个人使用来说应该绰绰有余。

签出项目

创建项目

将更改上传到您的项目

保持上游记录

如果您想跟踪上游项目(分叉创建自己的项目) ),则需要添加所谓的附加遥控器。基本上,这只是您在应用程序文件夹中时可以使用的另一个关键字。要创建新的远程服务器,请运行命令 git remote add上游https://github.com/username/project_name.git ,其中用户名应替换为原始项目的用户名,而project_name应替换为项目名称。

合并上游更改

如果您注意到上游项目已更新,并且希望合并更改,则可以运行创建额外的远程工具后,git pull up ,GitHub将从上游下载更改并将其合并到您的项目文件中。如果运行该命令后一切正常,则可以立即运行 git push origin master 将更新推送到自己的项目中。

拉请求

结论

GitHub is fantastic tool that a large amount of open source developers already use. While GitHub uses the Git utility which anyone can configure on their own servers, GitHub really incorporates the community aspect of development, something that is a requirement in the open source world. This introduction should help you get started with the basics. If you would like to learn more about actual programming, you can check out this article on top sites to brush up on C++ .

标签: