How to stage and commit backend changes — Basic
Use Git to save incremental work; commit working slices (feature, fix, migration) with clear messages.
Learn: Small, focused commits make code review and debugging easier. Commit when a vertical slice works (e.g. ‘users list endpoint returns 200’), not only at the end of the week.
Supplementary examples
Check what will be committed
git diff
git diff --staged
git commit -m "feat(users): add GET /users list endpoint"Course example
git status
git add src/users/users.service.js
git commit -m "Add list users service function"
git push origin main
Additional references & examples
- Git documentation
Version control basics: commit, push, and collaborate.
- Conventional Commits
Optional format for clear commit messages (feat, fix, chore).