CIS241

System-Level Programming and Utilities

git (intro)

Erik Fredericks, frederer@gvsu.edu
Fall 2025

Based on material provided by Erin Carrier, Austin Ferguson, and Katherine Bowers

CIS241 | Fredericks | F25 | 12-git-intro
(gdrive)
(dropbox)
(discord)
(copy pasta)

How do you share files?

Or backup/transfer files?

Or manage a group project?

CIS241 | Fredericks | F25 | 12-git-intro
(uh oh)

What are some issues with those?

  • How do you merge?
  • Multiple people editing at once?
  • File history?
  • Integrate into workflow?
  • Corruption? Accidental deletion? Lose a USB drive?
CIS241 | Fredericks | F25 | 12-git-intro

Source control!

Common options:

  • git
  • subversion

top-corner (git)

CIS241 | Fredericks | F25 | 12-git-intro

Version control systems

Software that tracks all changes to a repository of files

Benefits:

  • Full history
    • Rollbacks, traceability
  • Working concurrently
  • Merging
  • Files never fully deleted
CIS241 | Fredericks | F25 | 12-git-intro

Distributed version control systems

  • Each user has a local copy of all files
    • Including full history!
  • Allows for working offline
  • In theory, should make merging easier
CIS241 | Fredericks | F25 | 12-git-intro

Common version control systems

Distributed

  • git
  • mercurial

Centralized

  • subversion
  • perforce

bottom-right (distributed vs centralized)

CIS241 | Fredericks | F25 | 12-git-intro
(github logo)

Wot about GitHub?

git -- local

  • software
  • handles version control
  • operates locally

GitHub -- remote

  • Website/server
  • Stores git repositories
  • Additional features
    • Public sites
    • GitHub Actions
CIS241 | Fredericks | F25 | 12-git-intro

Touch of history on git

git:

  • The most widely used source code management tool: 42.9% of professional software developers use it as their primary source control system.

    • 90% respondents say they use Git (2021 StackOverflow survey)
  • Developed by Linus Torvalds in 2005 for use developing the Linux kernel

  • GitHub was developed in 2008, and provides free (and paid) Git repository hosting

    • Currently owned by none other than Microsoft!
CIS241 | Fredericks | F25 | 12-git-intro

Personal notes

git is complicated

You will mess things up / break things

  • I still do
  • Most mistakes are recoverable
  • Learn how to recover things!

Don't worry too much about the details

  • Get comfortable with the big picture
  • Look things up when you need (or are curious)
CIS241 | Fredericks | F25 | 12-git-intro
(git workflow)

The process

CIS241 | Fredericks | F25 | 12-git-intro

git: repositories

Git repositories contain:

  • A set of commit objects, and
  • A set of references to commit objects (heads)

Git repositories are stored:

  • In a .git sub-directory in the same directory as the project
  • There is no central repository server

Git is distributed!

CIS241 | Fredericks | F25 | 12-git-intro
(git vs subversion)
CIS241 | Fredericks | F25 | 12-git-intro

Where we're going

(git progress)

CIS241 | Fredericks | F25 | 12-git-intro

Where we're going

(git progress)

CIS241 | Fredericks | F25 | 12-git-intro

Today's work

  1. Install git
  1. Create a GitHub account - you'll be sending me your username

  2. Configure git on your machine

  • git config --global user.name "Your name"
  • git config --global user.email "Your email"
CIS241 | Fredericks | F25 | 12-git-intro

![bg (compression) opacity:0.25](https://materialdistrict.com/wp-content/uploads/2016/04/crushing-materials-hydraulic-press-chanel-goes-viral-01.jpg)

_color:white

both are free! * show actions examples * show how to build website

lots of little hacks around painful merging/rebasing...