← Git & GitHub learning path
Git & GitHub · Module 2 of 10

Your first repository

Create a repo, stage and commit changes.

📖 Key ideas

  1. git init creates a new repository.
  2. git status shows changed files.
  3. git add file stages changes; git add . stages all.
  4. git commit -m "message" saves a snapshot.
  5. git log shows history.
💡 Real-life example: Staging is putting items in a box; committing is sealing and labelling the box.
git initCreates a repository
Staging areaChanges prepared for the next commit
CommitSaved snapshot with message
git logShows commit history