Introduction to Git and GitHub
1 Welcome
Welcome to Git and GitHub! This course will teach you version control fundamentals and help you collaborate confidently using Git and GitHub.
2 Course Materials
Materials will be added here as we progress through the course.
https://gentle-git.njtierney.com
Prerequisites
- Basic computer literacy (creating files and folders)
- No prior experience with Git or version control required
- Helpful but not required: some experience with R, Python, or other programming
Learning outcomes
- Experiment freely without fear of breaking working code
- Collaborate with others without stepping on each other’s toes
- Share code publicly or privately with colleagues
- Track down when and where bugs were introduced
- Setting up Git and GitHub
- Push your code onto GitHub
- Understand how to use issues to track ideas or problems
- Use branches to manage features or changes
- Basic collaboration workflows (pull requests, merging, merge conflicts)
2.1 Schedule
2.1.1 Version Control Fundamentals
- The what and why of version control
- Git vs OneDrive/Google Drive/Dropbox
- Concepts, and terminology
- Repo, commits, branches,
- git vs github
- Installation and setup
- Git Handshake
- Setup with git/github
- Connect to RStudio/Positron/VS code
- Using
usethiswith git - The (many) ways of creating a git repository
2.1.2 Git Workflow
- Commit Early, commit often
- What makes a good commit
- .gitignore file
- How to write a useful commit message
- How to view commits / commit history
- How to look at differences between commits
- How to go back to another commit
- Public vs private repositories
- Tracking your work in github: Issues, Milestones, Labels, etc
2.1.3 GitHub and Branching
- Using branches
- Make changes without breaking code
- Link every branch to an issue
- Creating, moving between branches
- Merging branches and pull requests
- git hygiene
- Practicing branching
- Link branch and issue.
- Resolve issue.
- using usethis with
2.1.4 Collaborating with git
- Forking vs branching
- How to code review
- How to “import” someones changes onto your machine
- Merge conflicts
- What, and why?
- How to read merge conflicts
- Resolving conflicts
- Simulating, and practicing conflict resolutions
2.1.5 Github Actions
- github pages
- using github workflows to automate work
- Linking github with Zenodo
2.1.6 git: some more technical aspects
- Linking git with an existing project
- Some basic troubleshooting of common errors
- Understanding
git pushandgit pull - Push an existing project to GitHub
- git bisect to find bugs