Version control systems are at the heart of how programmers manage and share source code. Both Git and GitHub are ubiquitous in the world of software development, and you will benefit greatly from familiarity with them.
Git is a source code version control system (VCS), also known as version control. GitHub is a website providing Git repository hosting and an attractive and powerful Git web interface. It’s important to understand the difference: Git is the version control system that runs on your computer, while GitHub is a website that provides a nice user interface to Git and hosts your repositories online. Think of Git as the engine and GitHub as the dashboard you use to view and manage your code online. There is only one Git, but there are other GitHub-like Git hosting services: GitLab, Gitea, and so on.
One-time setup: Clone your project repository from GitHub using Claude in the Code tab of the Claude desktop app, then start your project sessions in the cloned folder.
Your regular workflow:
Your Claude Code activity itself is reported live as you work, so pushing is not what makes your time count.
But pushing is what saves your code, and it keeps a backup transcript of each session in .claude-sessions/, so commit and push regularly.
A source code repository might seem a bit like the shared folders that are provided by services like Dropbox, Box, or Google Drive. You can save files and folders and share them with other users in various ways. Some of these tools even allow you to track, undo and redo changes, and see how files have changed over time. These are useful tools, and a great way to collaborate with others in a variety of different scenarios. So it’s normal to wonder: what’s different about source version control?
Compared to tools like Dropbox, source version control provides programmers with several important advantages.
First, version control systems track the version of all the files in each repository, rather than individual files separately. Programming frequently involves making a set of changes to a group of files that together accomplish something—like fixing a bug or adding a new feature. So when you commit your work using Git, it remembers the state of all the files in your repository at that time. This allows you to compare what your project looked like at different times, and undo an entire set of changes that might have caused a problem.
Note that this also means that Git does not track all the changes you save to a file. Unless you commit your changes, they are not saved to your repository. This may seem like an annoyance—after all, systems like Dropbox will sync your files every time you save them.
But when programming this turns out to be a huge advantage.
Let’s say you save a version of Foo.java to test—but it contains errors.
Now if you are using Dropbox, everyone has that broken version of the file.
But if you are using Git, you can test your code, notice the errors, and fix them before committing.
A Git commit is really the equivalent of the save operation. However you save your files, you have to commit them to your repository before Git will save and remember them.
Version control systems also allow you to add your own notes to each commit. This is called a commit message. Commit messages should summarize what changes are included in the new version of the project. Good commit messages are extremely helpful to other developers that are trying to understand how the code is evolving. All version control systems have ways to view the list of versions with their commit messages. This can be useful when you want to see how things have changed, or back up and use an older version of a project where some feature was working that isn’t any more.
Second, version control systems help you merge changes made concurrently by different developers—even to the same file.
Say that Foo.java has 1000 lines.
Alice makes a change at the top of the file.
Concurrently, Bob makes a change to the bottom of the file.
Systems like Dropbox will typically force you to address this conflict by choosing either Alice’s version of the file or Bob’s.
But version control systems can frequently automatically merge non-overlapping changes to source code files—allowing you to choose to combine the changes from Alice with the changes from Bob.
When you are working in large teams on large software projects, this capability is extremely handy.
Let’s go through the basics of how to use Git. Please don’t consider this guide exhaustive—there are much more useful and up-to-date guides all over the internet.
Git organizes your files into a repository. A repository can contain any number of files organized any way you like. A single repository usually contains all of the code used by a single project. For CS 124, you will use a single repository for the independent project.
Git stores a copy of your repository on your local machine. But to back up your work and keep a backup copy of your session transcripts, you are going to push your changes to the GitHub Git hosting service.
Almost all of your interaction with Git this semester will be through Claude. You ask, and Claude runs the Git commands for you. Let’s walk through the workflow.
To begin the independent project you will clone your project repository from GitHub, which makes a copy of it on your laptop.
Your repository starts with a CLAUDE.md file that tells Claude about your project, and the hooks that report your Claude Code activity and save session transcripts.
You and Claude will set up the rest of your app from there.
First create your repository on the MP page, and accept the GitHub invitation it sends you. Then, in the Claude desktop app:
CS 124 in your Documents folder.There is no button for cloning a repository by its address: the clone happens in that conversation.
When it finishes, you have a new folder named after your repository inside your CS 124 folder.
Your repository is private, so the first time Git talks to GitHub it needs to know who you are.
repo scope, which you create on GitHub’s token page. Ask Claude to walk you through creating one if you get stuck.Set the token’s expiration to the end of the semester; a token that expires in 30 days will do so at the worst possible time.
The session you cloned from was started in the CS 124 folder, which is the parent of your project.
That session is not reported, and that is expected.
For all of your project work, start a new session in the cloned folder: the one containing CLAUDE.md, not the folder above it.
Click + New session, choose Local, then Select folder, and pick your repository’s folder.
If Claude asks whether you trust the files in this folder, answer yes.
Your project’s hooks only run in sessions started in that folder, and they are what make your hours count; see Effort Logging.
Version control systems only save the change you have made when you tell them to. This is called a commit, and the process called committing.
Once you commit a version of a file, Git will remember its committed contents forever—even if you change or delete the file. So you should get into the habit of committing early and often. Here are some good times to commit your code:
Get in the habit now of committing your code regularly. Version control systems are very efficient at storing commits, and so the overhead of performing them is small. Better to have things saved than to want desperately to get back to a previous version or remember how you did something and not have it committed.
The easiest way to commit is to ask Claude (try “please commit my work”).
You can also run Git yourself in the terminal pane of the Code tab, which you open with Ctrl+`.
You save your work to GitHub by pushing your commits. Pushing uploads your committed changes to GitHub, where they are safely backed up. A backup copy of your Claude Code session transcripts is included automatically with each push. Your Claude Code activity itself is reported live as you work, whether or not you push.
You should push regularly—at minimum, at the end of every work session.
Ask Claude to do this for you (try “please commit and push my work”), or run git push in the terminal pane.
If you want to work on your project on different computers (like a laptop and a desktop), Git makes this easy. The key is to use push and pull to keep your work synchronized through GitHub.
The golden rule: Always pull before you start working, and always push when you’re done. This ensures you’re working with the latest version of your code and that your changes are backed up on GitHub.
If something seems wrong with your repository, here are common problems:
CS 124 folder, or anywhere other than the folder containing CLAUDE.md, it is not reported.
Start a new session and select your repository’s folder; see above.git push in the terminal pane.cs124-illinois-students
organization.
If you’ve somehow created another repository on GitHub, remove it immediately once you’ve pushed to the correct repository.
It can put you at serious risk for committing an academic integrity violation.Want to learn more about Git? Here are some excellent resources:
And feel free to ask questions on the forum.