
Today we will…
A process of tracking changes to a file or set of files over time so that you can recall specific versions later.




Git is based on repositories.

By default:
You need to:
.gitignore).gitignoreSometimes there are files that you do not want to track.
.gitignore file specifies the files that git should intentionally ignore.
.gitignore is an “invisible file” in many file browsers/bin, .DS_Store) or files/directories that you do not want to be shared (e.g., solutions/)..Rproj files!.gitignore exampleDr. C’s .gitignore for her STAT 331 materials repo
Create an exact copy of a remote repo on your local machine.
(typically only done once at the beginning of a project.)

Tell git you have made changes you want to add (save ✅) to the repo.
local action
Also provide a commit message – a short label describing what the changes are and why they exist.
The red line is a change we commit (add) to the repo.

The log of these changes (and the file history) is called your git commit history.
Update the copy of your repo on GitHub so it has the most recent changes you’ve made on your machine.

Update the local copy of your repo (the copy on your computer) with the version on GitHub.

When you have an existing local repo:
Artwork by Allison Horst
These occur when git encounters conflicting changes.
We will work on resolving merge conflicts today!
But when all else fails…

R PackagesWork in your console or an Rscript for this.
usethis package.gitcreds Package.(Nothing should happen.)
Generate Token.When prompted to Enter password or token:, paste your PAT.
You will be completing this activity in groups of 3-4.
IMPORTANT
This activity will only work if you follow the directions in the exact order that I have specified them. Do not work ahead of your group members!
Artwork by Allison Horst
Office Hours
Tuesday from 9:30-11am and 2-3:30 pm.
None scheduled on Thursday but available upon request.