What is Git?

It's like a magic save button for computer code! Let's learn together!

{ }
</>
git

Git is Like a Time Machine for Code!

When you make something cool on the computer, like a game or a drawing, Git helps you:

  • Save your work so you never lose it
  • Go back to older versions if you make a mistake
  • Share your creations with friends
  • Work together on big projects

How Do You Use Git?

Programmers use simple commands to tell Git what to do. It's like giving your computer special instructions!

Terminal
computer:~ you$ git init
Initialized empty Git repository
computer:~ you$ git add my-cool-game.js
computer:~ you$ git commit -m "I made a awesome game!"
[master (root-commit) a1b2c3d] I made a awesome game!
1 file changed, 42 insertions(+)
create mode 100644 my-cool-game.js
computer:~ you$

git init

Starts Git in your project - like turning on a video camera

git add

Tells Git which files to save - like choosing what to record

git commit

Saves your work with a message - like pressing record!

Git Quiz Time!

Test what you've learned about Git with this fun quiz!

1. What is Git mainly used for?

2. Which command saves your work in Git?

3. What can Git help you do if you make a mistake?