
📎 This article includes 1 downloadable practice file ↓
If your folder has report_final.xlsm, report_final2.xlsm and report_final_REAL.xlsm, you already understand why Git exists. It records every version of your files, who changed what, and lets you go back.
In this article
The four ideas
- Repository — a folder Git is tracking.
- Commit — a saved snapshot with a message (“Fix VAT rounding”).
- Branch — a parallel line of work, so experiments do not break the main version.
- Merge — bring a branch’s changes back.
First project
git init # start tracking this folder
git add . # stage all files
git commit -m "First version" # save a snapshot
git log --oneline # list snapshots
git checkout -b new-report # start a branch
# ...edit files...
git add . && git commit -m "Add region chart"
git checkout master # back to the main line
git merge new-report # bring the work in
Undo mistakes
git diff # what changed since the last commit
git checkout -- macros.bas # throw away edits to one file
git revert <commit-id> # undo an old commit safely
Put your repository on GitHub or GitLab for a free off-site backup and easy sharing.
📎 Practice files for this article
- 📄All code from this post2 examples in one file, ready to open in your editor.⬇ SH · 900 B
Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time — plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul →Stuck on a step? Ask a question and the AI answers using this article.