What’s one interesting thing you did over the summer?
What do you hope to get out of the BIG Problems course?
Who is this introduction for?
Hopefully everyone here, but especially
Those who want a basic understanding of the version control process
Those who want to understand how open source collaboration works
Those who need to build a mental model of Git
Not for:
People who already use Git on the command line (you already have the mental model)
Impatient people
Learning Objectives
By the end of this discussion, you will be able to:
Explain the reasons we use repositories
Explain how version control tracks changes in your work
Make a branch in a repository
Make contributions to a repository using pull requests
Reminder: Be gentle with yourself and others
We are all learning together
We all learn at different paces
Asking questions is a way of taking care of others
Our focus today is on concepts
You’ll learn more of the details as you work with git/GitHub
…there’s just no substitute to actually using it…
Reproducibility and the Research Lifecycle
Benefits of Storing your code in a Repo
Centralized code
Other people outside your group/lab can use it
The ability to roll back changes that broke your code
Recognition for your work
Supportive community that can help you learn and improve it
It’s Tough being Open
But it’s also rewarding
Version Control
Version control is a systematic approach to record changes made in a file, or set of files, over time. This allows you and your collaborators to track the history, see what changed, and recall specific versions later when needed.
Ways we work with version control
By ourselves (sole developer)
As a member of a GitHub repository
As an external collaborator of a GitHub repository
Version Control Workflow (by ourselves)
Create files - these may contain text, code or both.
Work on these files, by changing, deleting or adding new content.
Create a snapshot of the file status (also known as version) at this time.
Document what was changed in the version history of that file.
You probably already do a version of this:
Git is a formal way of tracking changes
Each “save” is called a commit
Basically a snapshot of the file at that moment in time
We have one file, but many versions of that file
We only track changes in the file, not save the entire file
What’s the diff-erence?
Git only tracks what’s changed between commits (called a diff):
Lines of code we add (+)
Lines of code we delete (-)
Diff Example
Diff Example
We can fix mistakes
What if we made a mistake in code?
We can roll back or revert changes associated with a commit