While Git is mainly thought of as a collaboration tool, there's a lot you can do with Git on your own without collaborating with other people. Many of the Git workflows (e.g., Git-flow) can be done on solo projects too. Thus, we'll focus on the skills of using Git on your own, with remotes (e.g., GitHub), and branches. In essence, you will be "collaborating with yourself," before we go through the process of collaborating with other people.
What you'll learn-and how you can apply it
- Work with branches
- Push/pull branches and incorporate changes
- Collaborating (with yourself)
This training course is for you because...
- You who want to incorporate version control and more robust collaboration methods into your workflow.
- Basic command line skills: moving to directories and creating and editing plain text files
- Install Python using Anaconda: https://www.anaconda.com/distribution/
- Please follow the Carpentries instructions for installing Git (bash): https://carpentries.github.io/workshop-template/#git. It is especially important for windows users to check off using “nano” as the default text editor. The default editor will be set to Vim, and It’ll be very difficult to explain how to save and quit over a virtual classroom.
- We will be using GitHub as a remote, so please create a GitHub account beforehand. (You may use any other Git hosting service [e.g., Bitbucket, GitLab, etc] but the class will be using GitHub)
- Software Carpentry has a nice reference/cheatsheet: http://swcarpentry.github.io/git-novice/reference
- (live online training) "Git Basics" by Daniel Chen
- (video) Git Essentials LiveLessons, Daniel Chen https://learning.oreilly.com/videos/git-essentials-livelessons/9780134655284
About your instructor
Daniel Chen, trainer and data scientist, is a graduate student in the interdisciplinary Ph.D. program in genetics, bioinformatics & computational biology (GBCB) at Virginia Polytechnic Institute and State University (Virginia Tech). He is involved with Software Carpentry and Data Carpentry as an instructor and lesson maintainer. He completed his master’s degree in public health at Columbia University Mailman School of Public Health in epidemiology with a certificate in advanced epidemiology and is currently extending his master’s thesis work on attitude diffusion in social networks in the Social and Decision Analytics Laboratory under the Biocomplexity Institute of Virginia Tech.
The timeframes are only estimates and may vary according to how the class is progressing
Segment 1. Creating branches (15 min)
Segment 2. Making commits in branches (15 min)
Segment 3. Moving around different branches (20 min)
Break (10 min)
Segment 4. Merging branches (15 min)
Segment 5. Merging branches with remotes (20 min)
Segment 6. Pull requests (aka merge requests) (15 min)
Break (10 min)
Segment 7. Syncing up with your remote (15 min)
Segment 8. Multiple branches (15 min)
Segment 9. Incorporating hot fixes (15 min)
Segment 10. Discuss how the skills you learned directly apply to collaboration with other people
Course wrap-up and next steps (5 min)