Project Management and Git
Dennis Hazelett
Lecture 11 of “Applied Computational Genomics”
Spring 2022
This work, “Project Management and Git”, is licensed under CC BY SA 4.0 by Dennis Hazelett. Dinosaur image is from National Geographic “Billions of T. Rex likely roamed the Earth, paleontologists report”
Why Git?
The Git workflow
Stage new changes
Commit changes
Push to remote
What happens when we work on a project?
Project start
*
git add file_A.txt
“file_A.txt”
git add file_B.txt
HEAD
git commit ...
HEAD
MASTER
“Staging”
This is called a “local” repository (on your personal machine)
*
“file_A.txt”
MASTER
HEAD
Commit ID, parents and children
*
MASTER
HEAD
73db731
“child”
“parent”
Tags create extra flexibility for tracking progress
*
MASTER
HEAD
Release v0.9
“Tags” empower you to create stable releases or mark projects for publication
Tag example: Curriculum Vitae
MASTER
HEAD
“R01-42356 Enhancers”
Annotation: submitted spring 2021
“Tags” empower you to create stable releases or mark projects for publication
NIH Biosketch
Curriculum Vitae
*
Local vs Remote repositories
What is happening at the remote repository?
*
MASTER
HEAD
HEAD
MASTER
git push
Working collaboratively
A*
MASTER
HEAD
A
B
Working collaboratively
A*
TESTPILOT
HEAD
B
C
MASTER
$git add file_C.txt
$git add file_B.txt
B*
$git commit -m ‘add C’
TESTPILOT
HEAD
$git branch -c Testpilot
https://www.atlassian.com/git/tutorials/using-branches
Working collaboratively: the remote repo
A*
MASTER
HEAD
A
B
2 CHOICES:
Creating a new “repo”
Project start
“file_A.txt”
HEAD
MASTER
Creating a local mirror of the remote repo
Add an existing repo within Rstudio
The Git workflow
Homework for this lecture
Create a github account
Set up 2FA
Create a private repo in your account for this class
Clone the repo on your local computer and edit the README.md
Load all the past and present homework into your repo, stage, commit and push it to the remote
Add users ‘dennishazelett’ and ‘Simon-Coetzee’ with “view” permission
Hints: