Version Control and Github: Collaborating and Sharing Code

When developing software, programmers need some place to store their code and the changes between each version. They also need to be able to share it with others in order to collaborate with teammates or have others use it. This is what so-called version control systems do. They simplify organising code and managing changes. The most popular VCS is git. Though projects don't necessarily require git, it can make collaborating siginificantly easier. So, if you are working as part of a team, you should definitely use git.

Code is stored in a repository, often on online services. Think of it as Dropbox or Google Drive, but for code. The most popular service for storing and sharing code is GitHub. As the name suggests, GitHub uses git to push and pull changes from its servers. It also offers a range of facilities which will make your life easier. Thus, we suggest starting off with GitHub.

To learn more, see the git handbook by GitHub.

Using GitHub

To start off, you and any of your friends will need to create a GitHub account. Then, you can start learning the basics of GitHub's interface in their "Hello World" guide introducing GitHub's flow. After creating a repository, add any friends you want to work with on the repository by going to "Settings"->"Collaborators", and inviting their usernames.

Next, you will need a git client in order to manage your repository from your system. If your are comfortable working in a terminal, then you can simply use the command line. However, if you are a beginner, then we suggest starting off with a simpler client, such as GitHub for desktop, or, for something slightly more complicated, GitKraken.

If you use GitHub for desktop, then on the GitHub repository page on your browser for your project, you can click on on the big green “clone or download” button and click on “open in desktop”. Now the repository should appear in GitHub for desktop and you will be able to click the “fetch” and then “pull” button to get up to date. Next you can click on the little blue text in the center to open the repository in explorer.

Now all changes made in this folder will be tracked and saved on GitHub even if multiple people are working at the same time. In fact to save your changes you have to “commit” them by adding a name to the changes and then clicking “fetch” or “push” or “pull” (its all the same button!)

Advanced Version Control

Three is much, much more to git than is covered here. If you have experience using git and want to learn how to perform more complex operations, see "Pro Git".