This post is part of A Complete Beginner’s Guide To Hacking
How To Collaborate
One of the problems people encounter when working on projects collaboratively is always how to share and communicate the project so that every member of the team always has the most updated version of it. For lots of things this can be done by just having regular meetings, sharing Google Doc etc, so everyone has the same version. Well, for working on code projects together the most common way of ensuring all the different parts of the project are updated and working together is by using websites and software such as Github and Git.
Git is not the only option out there but it is by far one of the commonly used and has the most support for complete beginners to professionals so I am going to focus on that for this guide.
The idea is that you have a version of the complete code or project stored on either on your own computer or server, and one online in a “repository” on the website. You can edit your version and when you are ready you can upload and update the online version with your changes and of course download and update your version with updates and changes done by others to the online version. You can share the link to the repository with others so they can login to edit that repository with you – repositories can be private or public so you can choose who has access to them.
Most people edit the code using Git. This is a language that you use in the command line to interact with the different version of you code. If you want however there is a software you can download so you have a graphical interface (GUI) instead – you can drag and drop files and click buttons instead of using the command line. I would encourage using the CLI instead though as there is more support available for it and it is generally quicker to make changes by typing a few lines as opposed to opening up the software and clicking all the buttons.
An important feature of Github are the notes you write with any updates you make – known as your Git commit messages. They are supposed to describe the changes you’ve made to allow people to understand the changes without having to go through the code to find them. In theory, you should put a nice little message saying something like “Have changed the menu’s font colour to blue” but it isn’t uncommon for people to put increasingly brief and/or silly messages as they get more tired…
One of the other uses of systems like Github is the ability to undo changes to the code – to reverse the changes made and bring it back to an earlier version of your code, to try and help you identify where and when you might have made the mistake currently causing bugs. It is for this reason that it is incredibly important that you update the Github code version as frequently as possible – if you only update once a day then you might have to undo that whole day’s worth of work to find the problem, if you update every hour then you can just undo the minimal hours’ worth of work to find where it went wrong.
There aren’t that many commands to learn in the Git language but it is important to learn the differences between them so you know the steps you need to take in the right order to update everything correctly. Learning to use Github is an almost essential skill for coding, if you are ever going to work in a team, and one that is quite easily done – there are hundreds of courses out there to teach you the basics and answer all sorts of questions, I’m not going to repeat that here. I will however navigate you towards other resources to that such as:
- Github’s official website
- Codeschool have worked with Git to make brilliant tutorial in browser – here
- Gitref – is a clear and simple good reference for the commands
- Github training sheets
There are also alternatives to GitHub if you want to explore them such as Bitbucket or Kiln.