Your Git Journey: 0% Complete

Complete all episodes to become a Git master!

Episode 1: The Setup Saga

Student Avatar
I want to learn Git but don't know where to start! It seems complicated...
GASP!
Guru Avatar
Fear not! Git is like a superhero for your code! It helps you track changes, collaborate with others, and never lose your work.
ZAP!
Guru Avatar
First, we need the right tools. Think of VS Code as your coding workshop and Git as your super-powered toolbox!

Step 1: Install VS Code

Go to code.visualstudio.com

Open VS Code → Install extensions:

GitHub Pull Requests and Issues
GitLens (optional, helps understand Git history)

Why VS Code?

VS Code is like a Swiss Army knife for coding! It has built-in Git support, syntax highlighting, and thousands of extensions to make coding easier.

Episode 2: Git Installation Adventure

Student Avatar
VS Code is installed! What's next? Do I need more tools?
Guru Avatar
Now we install Git itself! This is where the magic happens. Git is like a time machine for your code!
WHOOSH!

Step 2: Install Git

Go to git-scm.com

Open terminal (in VS Code or system):

git --version

✅ If you see a version, Git is installed correctly!

What is Git?

Git is a version control system that tracks changes to your code. It's like "Save Points" in a video game - you can always go back if something breaks!

bash
$ git --version
Type 'git --version' in the input below
$

If you see something like git version 2.37.1 Git is installed properly!

Episode 3: Identity Crisis

Student Avatar
Git is installed! Can I start coding now? I'm ready to build amazing things!
Guru Avatar
Not so fast! First, we need to tell Git who you are. Every superhero needs an identity!
POP!

Step 3: First-Time Git Setup

In terminal, run these commands with your info:

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

This identifies you as the author of all your Git commits!

Why Set Your Identity?

When you work with others, they need to know who made which changes. It's like signing your artwork!

Example: If you're working on a team project, everyone will see that you fixed that tricky bug.

bash
$ git config --global user.name "Your Name"
$ git config --global user.email "your@email.com"
$

Try these commands in your terminal

Episode 4: First Commit

Student Avatar
Git knows who I am! What's next? I'm ready to start coding!
Guru Avatar
Now we create your first project with Git! This is where the fun begins. Think of it like building a Lego set with instructions that remember every step!
BAM!

Step 4: Create a Project with Git

Open VS Code → Open folder/project.

Initialize Git in your project folder:

git init

Create a file → save.

Stage & commit your changes:

git add .
git commit -m "First commit 🚀"

🎉 Congratulations! You've made your first Git commit!

What's Happening Here?

git initInitializes a new Git repository - Creates a new Git project

git add .Stages all changes for commit - Prepares your changes to be saved

git commitSaves your changes with a message - Takes a snapshot of your code with a message

bash
$ mkdir my-project
$ cd my-project
$ git init
$ echo "Hello Git!" > README.md
$ git add .
$ git commit -m "First commit"
$

Try these commands in your terminal

Episode 5: GitHub Connection

Student Avatar
I've made commits! How do I share my code with others? I want to show my friends what I built!
Guru Avatar
Time to connect to GitHub! This lets you backup and share your code. It's like putting your project in the cloud where everyone can see it!
ZING!

Step 5: Connect to GitHub

Make a repo on GitHub.com (click the + sign)

Copy the repo link (HTTPS)

In terminal, connect your local repo to GitHub:

git remote add origin https://github.com/yourusername/repo.git
git push -u origin main

Now your code is on GitHub! 🎊

Why Use GitHub?

GitHub is like a social network for code! You can:

  • Back up your projects
  • Collaborate with others
  • Showcase your work to employers
  • Contribute to open source projects
bash
$ git remote add origin https://github.com/yourusername/repo.git
$ git push -u origin main
Type the commands below to simulate
$

Try these commands in your terminal

Episode 6: GitHub Power Moves

Student Avatar
My code is on GitHub! What other cool things can I do with Git and GitHub?
Guru Avatar
Let me show you some power moves! GitHub is more than just storage - it's a collaboration powerhouse!
POW!

Advanced GitHub Commands

git clone https://github.com/user/repo.git

Clone an existing repository to your local machine

git branch feature-branch

Create a new branch for your feature

git checkout feature-branch

Switch to your feature branch

git pull origin main

Get the latest changes from the main branch

git push origin feature-branch

Push your branch to GitHub

GitHub Collaboration Workflow

1. Create a branch for each new feature

2. Make your changes and commit them

3. Push your branch to GitHub

4. Create a Pull Request to merge your changes

5. Collaborate with others through code reviews

6. Merge your changes after approval

bash
$ git branch new-feature
$ git checkout new-feature
$ # Make some changes...
$ git add .
$ git commit -m "Add new feature"
$ git push origin new-feature
Try these commands in the terminal below
$
Git Adventure - Learn Git the Fun Way!
Git Assistant
Hi there! I'm your Git assistant. I can help you troubleshoot any errors you encounter while setting up or using Git. What seems to be the problem?