Git tracks changes to your files. Saving work takes two steps: stage the changes you want, then commit them with a message.
git status
git add index.html
git commit -m "Add homepage"
git pushWhat each command does
git statusshows what changed.git addstages files for the next commit.git commit -msaves a snapshot with a message.git pushuploads your commits to the remote, such as GitHub.
Code examples
git init
git add .
git commit -m "First commit"git init creates a new repository; git add . stages every file in the folder.
Common mistakes
Common mistake: Vague commit messages
"update" tells nobody anything. Describe the change: "Fix menu on mobile".