Undo for your whole project
Ever broken something and wished you could go back? Git records commits — save points of your whole project, with a message saying what changed. Every professional team uses it, usually with GitHub or GitLab.
The everyday workflow
git init # start tracking this folder git status # what changed? git add index.html styles.css # choose changes for the next commit git commit -m "Add menu page" # save point with a message git log --oneline # history git switch -c dark-mode # new branch for a feature # …edit, add, commit… git switch main git merge dark-mode # bring the feature in git push # share commits with the remote (GitHub) git pull # get others' commits
- Commit small, focused changes often.
- Never commit secrets (passwords, API keys) — list them in .gitignore and keep them in environment variables.
- A merge conflict means two changes touched the same lines; Git asks you to choose.