
Using git and github

Information
The estimated time to complete this training module is 2h.
The prerequisites to take this module are:
- the installation module.
- the introduction to the terminal module.
If you have any questions regarding the module content please ask them in the relevant module channel on the school Discord server. If you do not have access to the server and would like to join, please send us an email at school.brainhack@gmail.com.
Module material
This module uses material created by Software Carpentry; specifically, their git Novice lesson. While the full Software Carpentry lesson material covers a half-day of content, we only cover a subset of the episodes here. Specifically, we cover:
- Automated Version Control
- Setting Up Git
- Creating a Repository
- Tracking Changes
- Remotes in GitHub
- Collaborating
A video of Elizabeth DuPre presenting related material is available below:
Additional resources
For students who are interested in learning more about git and GitHub, we highly recommend reviewing the full Software Carpentry lesson. Software Carpentry is also actively developing an intermediate level git and GitHub lesson, for anyone hoping to dive deeper into git and GitHub practices.
Exercise
- send a request at the “Using Git and Github” module post at the modules channels of Discord server by typing “@
please add my ” to the github organization." This will alert your local TA(s) to add you to the school-brainhack organization. - create a new repository within the school-brainhack organization following the naming convention
<last_name>_project. Don’t worry, you will be able to change this name later, and possibly merge the content in another repository if you decide to team up with other people. - initialize your repo with a README and a LICENSE.
- Create an issue for adding a short bio.
- Using the command line, clone the repository locally to your computer.
- Add a short bio to the README, including a picture of your github avatar. You can adapt the following snippet
<a href="https://github.com/lunebellec">
<img src="https://avatars.githubusercontent.com/u/1670887?v=4?s=100" width="100px;" alt=""/>
<br /><sub><b>Lune Bellec</b></sub>
</a>
This is a bit of html, which gets rendered in markdown documents. You will need to click on your profile picture to figure out what to replace 1670887 with the ID of your profile picture. Don’t forget to replace lunebellec by your github handle.
- Using the command line, commit this change to your local repository. Make sure you registered your github user name and email address, so the commit is accurately credited to you when you push it on github.
- Using the command line, push your changes to the github repository.
- Using the github interface, mention your new commit in the existing issue.
- Using the github interface, tag your local TA (by choosing their github handle among the listed ones) in the existing issue.
- Follow up with your local TA(s) to validate you completed the exercises correctly.
- 🎉 🎉 🎉 you completed this training module! 🎉 🎉 🎉
Even more resources
- For more detailed instructions please check GitHub’s resources
- The Turing Way discusses using for using GitHub for open research.
- For common Mistakes and Experiences with using Git and Github: dangitgit.com
- Jenny Tou wrote a git concept module and initially presented her workshops at Brigham and Women’s Hospital in 2019. The video found here is a shortern version of the original presentation ; please contact Jenny for the complete presentation materials.
- If you are curious to learn more advanced capabilities for git, you can check this tutorial “Effective use of git” by Ankur Sinha organized for the INCF/OCNS software working group.
- Here is an interactive page to learn Git and visually observe how the branching works under version control.