Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 1.4 KB

git-version-control.md

File metadata and controls

88 lines (61 loc) · 1.4 KB

Git Version Control Guide

This project already uses Git. Use this guide to track changes safely and consistently.

1) Check current state

git status
git branch --show-current
git remote -v

2) Stage changes

Stage all tracked and new files:

git add -A

Stage specific files:

git add .github/workflows/ci.yml README.md tests/test_main.py

3) Commit changes

git commit -m "feat: add CI fixes and test updates"

Use clear commit messages:

  • feat: new functionality
  • fix: bug fix
  • docs: documentation updates
  • test: test-only updates
  • chore: maintenance updates

4) Review history

git log --oneline --decorate --graph -n 20

5) Push to remote

If remote is already configured:

git push

If no remote exists yet:

git remote add origin <your-repository-url>
git push -u origin main

6) Create a feature branch (recommended)

git checkout -b feature/ci-improvements

Then commit and push:

git push -u origin feature/ci-improvements

Notes for this project

  • Keep poetry.lock tracked in Git to avoid CI dependency drift.
  • Pre-commit hooks automatically run lint and tests before each commit.
  • Run checks before committing:
poetry run pre-commit run --all-files

Or manually:

poetry run python -m hello_python.codestyle check
poetry run pytest -m "not slow" -q