Using Git as a student
Git is how Exponential is developed, installed (as clones) and improved. This page shows how a learner uses it every day. The full guide is Develop with Git; the commands are collected in the Git quick reference for learners.
Contents
- Three repositories a learner keeps
- Daily habits
- Learn from the history
- Commit messages
- Keep secrets out
- Staying up to date
Three repositories a learner keeps
| Repository | What it holds | Started with |
|---|---|---|
| The kernel clone | Exponential with its full history, on your own branch my-site | Installing from Git clones for study |
| Your extensions | One repository per extension or design you write, in extension/<name> | git init inside it (project 8) |
| Your notes | Your study journal, reports and hand-ins | git init in a folder outside the installation (Keeping a study journal) |
The extensions Composer installs are separate repositories too; git status in the root lists them as untracked
folders, which is expected (Develop with Git).
Daily habits
- Start the session with
git statusin the repository you will change. - Work on a branch, never directly on someone else's tag or on
mainof the project. - Commit small steps with clear messages; one commit per idea.
- End the session with
git statusandgit log --oneline -5: is everything committed? - Push your own repositories to your own account on a Git host, so a broken laptop does not take your work.
Learn from the history
The kernel's history is a textbook written by its developers. From Develop with Git:
git log --oneline -10 -- kernel/content/view.php # the last ten changes to one file
git blame kernel/content/view.php # who last changed each line
git log -S "CheckValidity" --oneline # every commit that added or removed a wordExercise: pick a setting you met in a study project, find the commit that introduced it with git log -S, and
explain in your journal why it was added.
Commit messages
The project's commit subjects start with what the change does: Added: , Updated: , Fixed: , Removed: or
Renamed: (Contributors guidelines). Use the same style in your own
repositories; it makes your history readable and your future pull requests familiar:
Added: The club event class and three sample events
Fixed: The event template escapes the title
Updated: The search test plan after the index rebuildKeep secrets out
- Never commit
settings/override/from an installation,kickstart.ini(it holds the database password, Getting started), API keys or passwords. - Use a
.gitignorein your own repositories for files that must stay local. - If a secret was committed, treat it as public: change the password or revoke the key, then remove it from the repository.
Staying up to date
Git first (the kernel), then Composer (the extensions):
git fetch origin --tags
git merge origin/main
composer updatecomposer update, not composer install, because the kernel's composer.json changed
(Develop with Git). The whole routine, with the database half of an
upgrade, is Update with Git. If Composer refuses because of your own changes, read
When Composer refuses.
Related pages
- Git quick reference for learners
- Develop with Git
- Your first contribution, step by step
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.