Day 1 Recap#

Homework: Weekend-Out

Best Practices#

  • Keep a healthy reference: Maintain a known, functional and up-to-date reference.

  • Separate changes: Group related work into coherent chapters on separate branches.

  • Make meaningful steps: Design each commit as a minimal, logically complete step in the history.

  • Flag states: Use tags to name and document repository states so they can be identified later.

The healthy reference gives everyone a reliable point of orientation as the project develops. Its state should be known, functional and as up to date as possible.

Separate changes as you would separate chapters in a story: each branch has a coherent purpose, and unrelated work belongs elsewhere.

Meaningful steps are small, complete logical steps in the history. A commit should not unnecessarily leave the branch in a broken or incomplete state.

Tags document states, while commit messages document changes. Naming a state makes it easier to recognize, communicate and return to it—for example, the version associated with a publication.

Feature Branch Approach#

  1. Define a self-contained feature or modification, with a clear scope and completion criteria.

  2. Start a dedicated branch to implement only that feature.

  3. Once implemented, ensure the changes are compatible with the current state of the reference branch.

  4. Merge into the healthy reference and retire the feature branch.

Remote-service tools can formalize this approach:

  • Issues: Define and discuss the feature’s scope and completion criteria.

  • Merge/Pull Requests: Document development on the feature branch, support review, and manage integration into the reference branch.

Git Commands & AI Agents#

Our recommendation: Encourage inspection but keep control over changes

✅ Delegate inspection

git status

Inspect the working tree and staging area.

git diff

Explain changes before deciding what belongs together.

git log

Explore commit history.

git show

Inspect a commit and its changes.

git reflog

Find previous positions of HEAD and branches.

git blame

Identify the last recorded change to each line—not its rationale.

🧑 Keep under your control

git add

Select changes for a small, coherent commit.

git commit

Define a meaningful, complete step in history.

git merge

Decide when changes are ready for integration; verify the resulting state.

git rebase

Reshape your branch’s history; never rewrite shared history.

git cherry-pick

Decide which changes belong on this branch.

git switch / git checkout

Choose where development happens; checkout can also overwrite changes.

Agents can advise. You remain responsible for the best practices.

These recommendations concern the usages described above, not every option a command offers. For example, git reflog inspects history, while git reflog expire modifies its records.