The daily loop
Last updated:
Clone once
Section titled “Clone once”git clone git@codebahn.net:acme/app.gitcd appSee what changed
Section titled “See what changed”git statusgit diffgit status lists which files changed. git diff shows the changed lines.
Commit
Section titled “Commit”git add README.mdgit commit -m "Explain how to run the app"The message is for whoever reads the history next year, which may be you. Five rules cover almost everything:
- Write the subject as an instruction: “Explain how to run the app”, not “Explained” or “Explains”.
- Keep the subject under 50 characters, start it with a capital letter, and leave off the period.
- Put a blank line after the subject.
- Use the body to say why, and anything a reader would not guess from the change itself. Wrap it at 72 characters.
- Commit one change at a time, so the subject can be honest.
A second -m adds the body:
git commit -m "Reject empty usernames" -m "The form let blank names through and created accounts nobody could use."In the history it reads like this:
Reject empty usernames
The form let blank names through and created accounts nobody could use.Some teams prefix the subject with a type, fix: or feat:, so tools can build changelogs and version numbers from the history. That convention is Conventional Commits. If your team uses it, follow it; the rules above still apply to the rest of the line. The Pro Git commit guidelines explain the reasoning.
Share and update
Section titled “Share and update”git pushgit pullWhile you worked, a teammate pushed a change of their own. git pull fetches it and merges it into your branch.
Read history
Section titled “Read history”git log --oneline -5Each line is one commit: a short hash and its subject.
What’s next
Section titled “What’s next”Git basics is licensed under CC BY 4.0: copy it, adapt it, keep the credit.

