Studio Matrx Monthly · Volume 1 · Issue 3 · August 2026
Amogh N P
 In loving memory of Amogh N P — Architect · Designer · Visionary 
Version Control with GitLesson 10.2
PSD for Architecture, Planning & Urban Design/Module 10 · Practice, AI-Assisted Coding & Career

Lesson 10.2 · Practice, AI-Assisted Coding & Career

Version Control with Git

Stop naming files script_final_FINAL_v3.py - git gives every version a save point you can return to, and a safe copy off your machine

13 min Interactive lessonFree · open lessonByAmogh N P· Architect & interior designer
The hook

You already version your drawings - Rev A, Rev B, Rev C. Git is that, for code, done properly, with the whole history one command away.

Every designer knows the pain of plan_final.dwg, then plan_final_v2.dwg, then plan_FINAL_actually.dwg - a folder of near-duplicate files where nobody can tell which is current or what changed. Code has exactly the same disease, and version control is the cure that the software world settled on decades ago.

The tool almost everyone uses is called git. It quietly records snapshots of your project as you work, so you can see what changed and when, return to any earlier version, and - crucially - keep a safe copy somewhere other than your laptop. This lesson gets you past the fear and into the four commands you will use ninety percent of the time.

init once. add + commit often. push to back up. .gitignore keeps junk out.

Why version control - the pain it removes

Imagine you spend an afternoon improving a script that generates a room schedule, and in the process you break something that worked yesterday. Without version control your options are grim: undo frantically and hope, or dig through script_old.py copies you may or may not have made. With version control, yesterday's working version is one command away, because git kept a snapshot every time you told it to.

That is the core idea: instead of hoarding whole copies of files with cryptic names, you keep one set of files and let git remember every committed state along the way. Each snapshot - called a commit - records the entire project plus a short message you write ('add CSV export', 'fix area bug'). Together they form a history you can read like a logbook and travel back through. Version control gives you four superpowers at once: a safe undo to any past point; a readable record of what changed and why; a backup that survives a dead laptop; and a way to share and collaborate without emailing zip files. Even for a solo designer with a folder of personal scripts, the first three alone are worth the small learning cost. You are not adopting a heavyweight process - you are buying insurance against ever losing work, and a memory of your own decisions. Think of the everyday alternative: a shared drive full of plan_final.dwg, plan_final_v2.dwg and plan_FINAL_actually.dwg, where nobody can say which is current, what changed between them, or why. That is version control done badly, by hand, and every designer has suffered it. Git is simply that same instinct - keep the old versions, know what changed - done properly, automatically, and without the sprawl of duplicate files. The small cost of learning it is repaid the very first time you need yesterday's working code back.

A COMMIT TIMELINE = SAVE POINTSa1b2c3d4initial scriptadd CSV exportfix area bugHEAD (now)MonTueThutodayany commit is a save point you can return toEach commit stores the whole project + a message. History is a chain you can read, revisit and undo.
Zoom
A commit timeline is a chain of save points. Each commit stores the whole project plus a short message, and any one of them is a state you can return to. The history reads like a logbook of what you changed and why - the exact thing a folder of file_v3 copies can never give you.

One set of files + a history of snapshots. Not fifty copies with scary names.

The everyday loop - init, add, commit

Git has a fearsome reputation, but the daily reality is a short loop of a few commands. You run these in a terminal, inside your project folder. First, once per project, you turn the folder into a git repository:

bash
cd my-scripts
git init

That creates a hidden .git folder where git keeps its history - you never touch it directly. Now you work as normal, editing your Python files. When you reach a point worth saving, you do the two-step that trips up every beginner until it clicks. First you stage the changes you want in this snapshot with git add, then you commit them with a message:

bash
git add schedule.py
git commit -m "Add habitable-area total"

Why two steps? Because staging lets you choose exactly what goes into a commit - you might have changed three files but only want two in this snapshot. Think of git add as putting things in the box, and git commit as sealing and labelling it. Write commit messages for your future self: "Fix off-by-one in room loop" tells you something in six months; "stuff" and "asdf" tell you nothing. A good rhythm is to commit each time you get one small thing working - little and often beats one giant commit at the end of the day. To see where you are at any moment, git status shows what has changed and what is staged, and git log prints the history of commits.

WHERE YOUR WORK LIVESWorking dirfiles you editStagingwhat goes nextLocal repoyour historyRemoteGitHubgit addgit commitgit pushadd picks what to save, commit records it with a message, push copies it off your machine.
Zoom
The four places your work lives and the three commands that move it between them: git add stages what you want to save, git commit records it into your local history with a message, and git push copies that history to a remote like GitHub - your backup off the machine.

GitHub - a backup and a home for your code

So far everything lives on your machine, which means a dead laptop still loses everything. The fix is a remote - a copy of your repository hosted elsewhere - and by far the most popular host is GitHub. You create an empty repository on GitHub, connect your local project to it once, and from then on you push your commits up:

bash
git remote add origin https://github.com/you/my-scripts.git
git push -u origin main

After that first setup, sharing new work is a single git push. Your commits are now backed up off your machine, visible from anywhere, and - if you choose - shareable with others. On another computer you git clone the repository to get the whole project and its full history. This is also how you use other people's tools: you clone their repository, read their code, and run it.

GitHub is more than storage. It renders your README (a plain-text description of what the tool does and how to run it), tracks issues, and shows your work to the world - which matters enormously for a computational designer's portfolio, the subject of Lesson 10.4. For a designer, the honest starting point is simple: push your useful scripts to GitHub so they are safe and findable. You do not need branches, pull requests or the collaborative machinery on day one - those are worth learning when you actually work with others, and they build naturally on the same commit-and-push loop you already know.

commit = save locally. push = copy to GitHub. clone = get someone's whole project.

.gitignore and what NOT to commit

Not everything in your project folder belongs in git. Big data files, exported images and PDFs, secret keys, and the noise your tools generate (like Python's __pycache__ folder or a virtual environment) should be left out - they bloat the history, and secrets committed to a public repo are a genuine security incident. Git handles this with a plain-text file called `.gitignore`: you list patterns of files to ignore, and git pretends they are not there.

A sensible starting .gitignore for a Python project reads:

__pycache__/
*.pyc
.venv/
*.csv
*.pdf
exports/
secrets.txt
.env

Each line is a pattern - *.csv ignores every CSV, exports/ ignores that whole folder. Commit the .gitignore itself (it is small and useful), and from then on git quietly skips those files. The rule of thumb: commit the source - your `.py` scripts, your README, small sample inputs - and ignore the derived, the huge, and the secret. A repository should be the recipe, not the meal. Getting this right early keeps your history clean and, more importantly, keeps you from ever pushing a password or an API key to a public place where it cannot be truly taken back. If you ever do commit a secret by accident, treat it as compromised and rotate it - deleting it in a later commit does not remove it from history. A good habit is to write the .gitignore before your first commit, not after, so the junk never enters the history in the first place; cleaning it out later is far more work than keeping it out from the start. Most editors and GitHub also offer ready-made Python .gitignore templates you can copy as a sensible baseline and then adjust.

Commit the recipe (.py, README), not the meal (exports, data, secrets).

Reading history and undoing safely

The payoff of committing regularly is that your history becomes a tool, not just a record. Three everyday commands turn it into a safety net. git log prints your commits newest-first, each with its message and a short hash (an id like a1b2c3d) you can refer to. git diff shows exactly what has changed since your last commit - line by line, additions and deletions - which is invaluable for answering 'what did I actually change?' before you commit. And git status, run constantly, tells you what is modified and what is staged.

bash
git status          # what has changed?
git diff            # show the exact line changes
git log --oneline   # compact history, one commit per line

The genuine relief comes when something breaks and you want to go back. If you have edited a file into a mess but not committed, git restore <file> throws away your uncommitted changes and returns it to the last committed state - the safe undo that makes experimenting fearless, because you know a working version is one command away. If you need to inspect an older commit, you can check it out by its hash and look around. Because every commit is a complete snapshot, none of this is risky in the way overwriting files by hand is.

There is more to git - branches let you develop a new feature in isolation without disturbing your working version, and pull requests on GitHub let a team review changes before merging - but you do not need them on day one. They build naturally on the same add/commit/push loop once you collaborate or want to try a big change safely. For a solo designer, the honest minimum is powerful enough: commit often with clear messages, push to back up, and lean on log, diff and restore when you need to understand or undo. That alone means you never truly lose work or wonder what changed again.

git log = history. git diff = what changed. git restore = safe undo.

Commands and terms in this lesson

git init

Turn a folder into a git repository

Run once per project. Creates the hidden .git folder that stores all history; you never edit it by hand.

git add / commit

Stage changes, then record a snapshot

add chooses what goes in the box; commit seals and labels it with a message. The core two-step of every save.

git push / clone

Copy commits to a remote / get a repo

push backs your work up to GitHub; clone downloads someone else's project with its full history.

.gitignore

A list of files git should not track

Keep data, exports, virtual environments and secrets out of history. Commit the recipe, not the meal.

Hands-on workshop

Workshop - put a real script under version control

Take a script you have written in this course and give it a proper home: a git repository with a clean history and a backup on GitHub. By the end you will have done the whole loop once, which is all it takes for it to stick.

git installed (git-scm.com), a free GitHub account, and any script from an earlier lesson.

Given & goal
Goal: a script under git, committed a few times, pushed to GitHub
Inputs: one of your .py files, a free GitHub account, git installed
Time: ~35 minutes
  1. 1Make a folder for the project, move your script into it, open a terminal there, and run git init. Then create a .gitignore listing __pycache__/, *.pyc, .venv/ and any data or export files, and save it.
  2. 2Run git status to see your untracked files. Stage everything you want tracked with git add ., run git status again to confirm what is staged, then make your first commit: git commit -m "Initial version of room-schedule script".
  3. 3Make a small improvement to the script - rename a variable, add a comment - then repeat git add and git commit -m "..." with a message describing the change. Run git log and read your two-entry history.
  4. 4Create a new empty repository on GitHub (no README, to keep it simple), copy the URL it gives you, and connect it: git remote add origin <url>. Then git push -u origin main to upload your commits.
  5. 5Refresh the GitHub page and confirm your script and both commits are there. Add a one-paragraph README on GitHub describing what the script does and how to run it - your first piece of shared documentation.

You’ll walk away with
A public or private GitHub repository containing your script, a sensible .gitignore, at least two well-described commits, and a short README explaining what the tool does.

The worked example

Three altitudes on the same idea

Read the band that fits you — or all three.

For the architectAutomate busywork & build custom tools

In a practice, a script that generates issued output must be reproducible and recoverable - git gives you both. When a client asks why a schedule changed between two issues, the commit history is your audit trail. When a shared studio tool needs updating, GitHub lets the team pull the current version instead of passing around tool_v7_final.py. Start solo: put your practice's scripts in a private GitHub repository and you have backup, history and a foundation for collaboration in one step.

For the interior designerScripts for data, schedules & layouts

Your scripts evolve project by project, and git lets you branch off a proven tool without fear of breaking it. Keep a repository of your FF&E and finishes scripts; each time you adapt one for a new client, commit before you experiment so yesterday's working version is always recoverable. Pushing to a private GitHub repo also means your carefully built tools survive a laptop failure - and are ready to reuse the moment the next project needs them.

For the studentA hireable computational skill

A public GitHub profile is the modern portfolio, and employers in computational roles genuinely look at it. Start committing your coursework and personal scripts now - a steady history of small, well-described commits signals exactly the reliability studios want. Learning git is also non-negotiable for the BIM, Computational Design and Generative AI courses in this Academy, and for any collaborative studio project where several people touch the same code.

Misconception check

Git is overkill for a solo designer - it is for big software teams, not my little scripts.

The collaboration features of git are indeed built for teams, but three of its four core benefits apply fully to a solo designer with a handful of scripts: safe undo to any past version, a readable record of what you changed and why, and a backup that survives a dead laptop. Those alone repay the modest learning cost the first time you break a working script and calmly return to yesterday's commit, or the first time a hard drive dies and your work is safe on GitHub. You can ignore branches, pull requests and the team machinery entirely at the start - the everyday loop is just init, add, commit, push. Far from overkill, basic git is the cheapest insurance a person who writes any code can buy.
Try it

Do it yourself

Check your grip on the everyday loop.

  1. 1In your own words, what does a single commit store?
  2. 2What is the difference between git add and git commit?
  3. 3What does git push do, and why does it matter for backup?
  4. 4Name two kinds of file that belong in .gitignore, and say why.
  5. 5Why is 'fix off-by-one in room loop' a better commit message than 'stuff'?
Take this with you

The one line to carry out

Version control replaces a folder of scary-named copies with one project and a readable history of snapshots: init once, then add, commit and push in a short loop - so you can undo to any point, see what changed, and never lose work to a dead laptop again.
Take it further
References & further reading

Peer-reviewed journals & authoritative standards

  1. 01GitWikipedia, 2026.
  2. 02Version controlWikipedia, 2026.
  3. 03Git - official siteSoftware Freedom Conservancy, 2026.
  4. 04GitHubGitHub, Inc., 2026.
Related lessons
Recap
Version control cures the filefinalv3 disease by keeping one set of files plus a history of committed snapshots. The everyday git loop is small: init once, then repeatedly add (stage), commit (record with a message) and push (back up to GitHub). GitHub also hosts, documents and shares your code. A .gitignore keeps data, exports and secrets out of history - commit the recipe, not the meal.
Carry forward →

Now your code is safe, versioned and shareable. Next we add a different kind of leverage on top of it - AI coding assistants that draft and explain code - and the literacy needed to use them well rather than be misled by them.

A

The author

Amogh N P

Architect, interior designer, and creative polymath. Studio Matrx began in his notebooks — his vision of design made honest, useful, and open to everyone. Its Academy is written and taught in his memory, and free, forever.

More about Amogh →