By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/
Getting GitHub set up for newbies
Looking to contribute to the development of Joomla? Then you’ll need to know about a little thing called GitHub.
If you know what we’re talking about…
If you’re an established Open Source software contributor or developer, this article might not have much value for you. You’ll have been pushing and pulling on forks and branches for years, carefully honing the code and testing your creations using Git, sculpting the Joomla project and watching your commits turn into pull requests, which in turn are pulled back in to improve the award-winning open source content management system readers of the Joomla Community Magazine (JCM) love.
That said, it would be great to hear from you about how to use GitHub and Git, as we’ll be embarking on a series of tutorials and articles to engage Joomla contributors and volunteers. Leave a comment, or contact the author (details below).
Much of the above paragraph will be a blur of jargon.
Where to begin? Oh, that’s right, that’s what this article’s about, so I’m going to learn with you as a newbie myself to GitHub. And don’t worry - there’s a lot to learn, so this is going to turn into a series over a few issues of JCM. If there’s something you want more information on, let us know in the comments.
In this introduction, we’re not even going to get to setting GitHub up to contribute to Joomla… we’re just going to get you through the basics.
But if you are ready to jump in, there are some resources at the end of the article to help you with getting started while we’re putting together the next article in the series.
Let’s first take a look at what GitHub is.
“GitHub is how people build software”
GitHub is a massive ecosystem. Chances are if you’ve used any open-source software in the past decade, it’s got a repository on GitHub. Started in 2007, GitHub is used by over 50 million developers globally working on over 100 million repositories1.
Repositories are the name for the space on GitHub where a project lives. You can have your own project with its own repository, or you can follow other developers' projects and repositories. Big projects, like Joomla, may have many repositories you can join and contribute to, or just watch for updates on issues being worked on.
GitHub is a bit of a social network for developers in that regard - it’s a bit like a Facebook or LinkedIn Group, and you’re seeing what news the project has by watching for updates to the project’s code. But then you add in project management, and you quickly see how software develops when users report issues, developers update code to resolve the issues, and the new code is then pulled back into the master code base to improve the project.
Joomla is set up on GitHub as an organisation, which lets the project be managed centrally, and other sections of the project, including the Joomla Community Magazine, have their own repository for working on the different sections of joomla.org. Currently, Joomla has dozens of repositories for different parts of the project.
. With a GitHub account, you can go watch and contribute to the joomla-cms repository. At the organisation level, you can Volunteer, and as part of the onboarding process, you’ll be invited to join the Joomla Project on GitHub (be sure to sign up to GitHub first), and then you’ll be able to contribute to the various team repositories.
Find out more about current Joomla Volunteer opportunities at volunteers.joomla.org.
GitHub has its own glossary of terms that describe all the things you do in GitHub. The quickest way to learn some of the terminology like repositories, branches, commits, and Pull Requests is to spend some time reading through GitHub Guides, and a good starting point is just going through Understanding the GitHub flow. That covers the basic concepts of GitHub work, and you can then move on to try it yourself with the GitHub Hello World activity.
That covers some of the basics, and GitHub Guides go on to take you through a number of other concepts in GitHub. For those of you who are more visual learners, GitHub has a GitHub Training & Guides Youtube Channel with hours of videos and a number of playlists that focus on particular learning areas.
GitHub vs Git
One thing that can confuse beginners is what the difference is between GitHub and Git.
Git is a distributed version control system. It is a system that records changes in files and keeps these changes in a history file. You can always look back to an earlier version of your code and restore changes if you like. Because of the history archive, Git is very useful when you work with many people together on the same project.
GitHub is one of a number of cloud services specialising in the hosting Git repositories, as well as the provision of tools for features like issue tracking, collaboration and project management. GitHub is the service used by the Joomla Project and millions of others, and so our articles will be focussing on how to do things with Git and GitHub, as opposed to services like BitBucket or GitLab. GitHub wouldn’t exist without Git.
You can use GitHub to perform a number of Git functions, but to really make the best use of Git, you need to set up Git locally on your computer. You would also create a test environment so you can test your code as you go, and then create a Pull Request when you’re done to have the solution incorporated back into the master branch of the project if your solution is accepted.
Next time around, we’ll be coming back with a tutorial on both setting up Git and a test environment, as well as how to make a contribution to a repository… maybe even the Joomla CMS itself.
Joomla Docs on using GitHub:
1GitHub figures as of August 2019