Your first commit: add and commit
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
A commit takes two steps:
echo "# My project" > readme.md # created a file
git add readme.md # 1. put the change into the index
git commit -m "first commit" # 2. saved a snapshot with a message
git add . adds all changed and new files in the folder to the index. It's convenient, but it's easy to commit something extra by accident, so check git status first.
The commit message (-m) is a short description of what was done: "Add the login page", "Fix the XP calculation". Messages like "fix" or "asdf" won't tell you or your team anything a month later.
After the commit, a circle appears on the graph on the right — that's your snapshot.
Task. Create a file readme.md with the text # My project, add it to the index and make a commit with the message first commit.
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.