Practical guide

Git Basics: Save and Review Changes in a Project

Git records project changes so you can review how files evolved and return to a known version. A commit is a local snapshot; pushing to a remote repository is a separate action.

What to do

  1. In a project folder, run git status to see changed and untracked files before staging anything.
  2. Use git add path/to/file for specific reviewed files, then run git diff --cached to inspect exactly what will be committed.
  3. Create a focused commit with git commit -m "Describe the change". Use a message that summarizes the change rather than claiming it is complete or tested when it is not.
  4. Run git log --oneline -5 to review recent commits. Configure a remote and use push only when you intend to publish those commits to the shared repository.

Checks and limitations

  • Do not commit passwords, access tokens, private keys, or customer data. Remove exposed credentials and rotate them if they were already published.
  • Git does not replace backups, and a local commit is not automatically copied to another computer.