Week 1 — Unity Fundamentals · w1d2 · 2h 31m

W1D2: Version control and the Unity interface

Git from scratch (init, add, commit, branches, push, SSH keys, .gitignore) plus a first tour of the Unity editor's main windows and tools.

Lucian Lazar · 10 Jul 2024

Day two splits neatly in half: version control first, then the Unity interface. Lucian warns up front that the git half runs long, and it does — roughly two thirds of the session. If you’ve never used git, or you’ve been zipping project folders into “final_v3_REAL” for years, this is the part that fixes that habit before it becomes your career.

What’s covered

Version control, explained as quicksaves

  • The mental model: commits are checkpoints, branches are parallel timelines, HEAD is which reality you’re currently standing in. Lucian leans on this analogy the whole way through because it works.
  • Why it matters beyond backups: you stop being afraid to break things. His words — you should have the freedom of a child smashing stuff to see how it works.
  • A blunt aside: he’s met developers with years of experience who don’t use version control at all. Dropbox sync, Google Drive, a folder. “It’s using a tool that was not made for this.”

Git on the command line (just enough to understand it)

  • Creating a file, git init, and finding the hidden .git folder (Cmd+Shift+Dot on Mac, folder options on Windows).
  • git status, git add ., git commit -m, git log. The two-step add-then-commit flow and what the staging area actually is.
  • Tracked vs untracked files, and why git tells you what to do next in its own output.
  • Setting your name and email via git config so commits get attributed properly, including using GitHub’s noreply email.
  • Commit message guidance: no strict rules, but commit small and commit often, especially when other people need to pull your work.

GUI clients

  • Lucian admits he barely knows command-line git after 11 years of Unity work. He uses SmartGit for everything and recommends it — free for personal use, cheap licence, no sponsorship.
  • Resetting HEAD to an earlier commit visually, then recovering the “lost” commit from the recyclable commits list. Git is hard to permanently lose things in.
  • Alternatives: VS Code plus the GitLens extension (free, plenty of people use it for life), GitKraken (free for public repos only), SourceTree, Fork. Stay away from GitHub Desktop — his take is that it’s limiting and you may as well learn a good tool from day one.

GitHub and remotes

  • Creating a repository, copying the URL, remote add, then push. Watching the branch indicator go from orange to “equal to origin”.
  • Generating an SSH keypair with ssh-keygen -t rsa, where the keys live, and pasting the public key into GitHub’s SSH keys page. A one-time setup per machine.
  • Fetch vs pull, and reading the little puzzle-piece indicator that shows your local branch is behind origin.
  • Forks, pull requests, and a short bit on why GitHub exists at all — open source, shared tools, people contributing fixes back.

.gitignore for Unity

  • Pulling the Unity template from the github/gitignore repo (160k stars, as Lucian points out).
  • The rule: commit the minimum set of files that represent your project. Anything derived — builds, the Library folder, Temp, obj, .sln files, .apk — stays out. Duplicating derivable data makes the repo heavy and slow for no reason.
  • The .gitignore file itself must be committed, since it’s per-repository and everyone needs it.

Git flow, briefly

  • Master as released versions, develop as the source of truth, feature branches, release branches, hotfixes branched straight off the last release.
  • He’s clear this is overkill for you right now. You’ll have one branch and a straight line of commits. It’s here so you can come back to it when you’re on a team.

The Unity editor tour

  • Scene view, game view, and the device simulator (a package, not a real emulator — for that you need Xcode, Android Studio or Genymotion).
  • Hierarchy, parenting, and how attaching a camera to a cube is exactly how you attach a camera to a player.
  • Inspector and components: Transform on everything, Mesh Filter for shape, Mesh Renderer for actually drawing it, Collider for physics, Rigidbody for gravity.
  • Navigation and tool shortcuts: Q/W/E/R/T, alt (or option) plus left click to orbit, middle mouse to pan, scroll to zoom.
  • Project window, one-column vs two-column layout, and searching by asset type (t:texture, t:audioclip).
  • Console: info, warning and error levels, and Debug.Log output.

Timestamps

  • 00:04:10 — What day two covers, and a warning that it’s git-heavy
  • 00:05:30 — Version control as quicksaves and checkpoints; why you shouldn’t be afraid to break things
  • 00:09:00 — People who skip version control entirely, and why SVN/Perforce don’t matter to you yet
  • 00:13:00 — Creating a test file in VS Code, opening a terminal, installing git
  • 00:16:40git init, the hidden .git folder, showing hidden files on Mac and Windows
  • 00:20:30git status, git add ., and what the staging area means
  • 00:25:00git commit -m, git log, and setting your commit author via git config
  • 00:33:00 — Modifying and adding files; tracked vs untracked output
  • 00:38:00 — Commit message habits: small, often, especially on a team
  • 00:43:00 — Branches, HEAD, main vs master
  • 00:47:00 — SmartGit: adding the repo, resetting HEAD back, recovering commits
  • 00:56:00 — Branching and merging on a team, and why merge conflicts aren’t scary
  • 01:03:00 — Creating a GitHub repo, remote add, first push
  • 01:10:00ssh-keygen, public vs private keys, adding the key to GitHub
  • 01:22:00 — Fetch, pull, and reading the branch-ahead/behind indicators
  • 01:28:00 — .gitignore: grabbing the Unity template and why builds never get committed
  • 01:41:00 — Git flow: develop, feature, release and hotfix branches
  • 01:52:00 — GUI client comparison; GitLens in VS Code; why not GitHub Desktop
  • 02:03:00 — Unity editor: scene, game and simulator views, hierarchy basics
  • 02:12:00 — Parenting a camera to an object, pivots, scene navigation shortcuts
  • 02:20:00 — Inspector and components: mesh filter, renderer, collider, rigidbody
  • 02:30:00 — Project window, asset types, console and Debug.Log
  • 02:38:00 — The course support repo, and picking your final project game

What you build

A throwaway repo you can afford to wreck. You’ll make a file, initialise git on it, stage and commit it, break it, commit again, push it to GitHub, reset HEAD backwards, recover the commit you thought you deleted, add a .gitignore, and pull a change made directly in the GitHub web editor. That’s the full daily loop of a working developer, done on a two-line Python file so nothing is at stake.

You also end up with the setup you’ll use for the rest of the course: git installed, an SSH key on your GitHub account, a GUI client of your choice, and the course’s support project cloned locally.

The command sequence, if you want it as a reference:

git init git status git add . git commit -m “first commit” git log git remote add origin git push The Unity half is deliberately shallow. Lucian pokes around a scene, drops in a cube and a plane, adds a Rigidbody so the cube falls, parents the camera to the cube and moves it around to show what parenting does. No scripting yet beyond looking at an existing jump script and a button counter that logs to the console.

Who should watch this

Anyone starting the course who has never touched git, and anyone who’s been avoiding it because the command line looked unfriendly. Lucian’s position is that you can be fully productive with a GUI and know almost no command-line git, which takes the pressure off. The Unity section at the end is orientation only, so if you already know the editor layout you can stop around the two-hour mark.

Part of the full curriculum. Course overview.