Version Control and GitHub

AI Track
--- theme: default routerMode: hash favicon: https://oim3690.github.io/favicon.svg titleTemplate: "%s - OIM3690" title: "Version Control and GitHub" info: "Module A-GIT-001 — version control concepts, GitHub, GitHub Desktop workflow" --- # Version Control and GitHub --- # Version Control - **Version control** is a method of keeping track of changes to files over time - **Why** do you need it? - Do you have folders that look something like this? ``` essay_v1.2 [20260101] essay_v1.2.1 essay_20260103_edited_Prof_Li code_v1.2 (OLD!) code_v1.1 (DO NOT DELETE!) ``` Version control solves this! --- # Git <img src="./images/git.png" class="w-60 mx-auto" /> --- # Git - The most widely used version control software is called [**Git**](https://git-scm.com/) - You can run `git` locally, but it is better to use an online provider - Storing your version control online makes it much less likely to lose it! - Major providers: - **GitHub** (most popular) - GitLab - BitBucket --- # Why GitHub? - **Version control**: Track every change you make - **Backup**: Your code is safe in the cloud - **Portfolio**: Employers look at your GitHub profile - **Collaboration**: Work with others easily - **Deployment**: Host your websites for free! > Your GitHub profile is your coding resume. Start building it today. --- layout: image-right image: ./images/github-desktop-screenshot.png imageWidth: 60% --- # GitHub Desktop A visual app for Git — no command line needed. - See your changes - Write commit messages - Push to GitHub --- # Repositories You'll Create | Repo Name | Purpose | URL | |---|---|---| | `oim3690` | Course work (exercises, logs) | | | `username.github.io` | Personal website | `https://username.github.io` | | `[project-name]` | Mini projects and Final Project | `https://username.github.io/[project-name]` | --- # Basic Workflow 1. **Create** a repository (or clone an existing one) 2. **Edit** files in VS Code 3. **Commit** to save your changes locally 4. **Push** to upload your changes to GitHub > Pull → Edit → Commit → Push. Repeat. --- # Commit and Push Using **GitHub Desktop**: 1. You'll see your changes listed 2. Write a commit message that describes your changes 3. Click **Commit to main** 4. Click **Push origin** Your changes are now on GitHub! --- # Gitignore There are things you don't want to sync with GitHub: - Data files - Credentials / secrets - "Byproduct" files (`.DS_Store`, `node_modules/`) A `.gitignore` file tells Git which files to automatically ignore. --- layout: image-right image: ./images/GitHub-clone.png imageWidth: 40% --- # Cloning a Repo To work on a repo locally: 1. Go to the repo on GitHub 2. Click **Code** → **Open with GitHub Desktop** 3. Choose a location on your computer 4. Click **Clone** --- # Learn More - [Official Git documentation](https://git-scm.com/book/en/v2) - [Learn Git Branching](https://learngitbranching.js.org/) (interactive) - [Version Control](https://missing.csail.mit.edu/2020/version-control/) — MIT Missing Semester

Topics Covered

  • version control concepts
  • Git basics
  • GitHub Desktop workflow (commit, push, pull)
  • repository setup
  • gitignore

Content Slides Open fullscreen ↗

Taught In

  • Monday, 5/18 — Course intro · GitHub setup · Build your first website