Git & GitHub Fundamentals

3 / 53
1 min read

Git & GitHub Fundamentals

Git is a version control system that tracks changes to your code. GitHub is a platform where you can store and share your repositories.

1

Why Git?

Track history - : See every change made to your code
Collaborate - : Work with others on the same project
Revert changes - : Go back to a previous version if needed
Branching - : Work on features without affecting the main code
2

Basic Git Workflow

1. git init — Create a new repository

2. git add <file> — Stage changes

3. git commit -m "message" — Save changes

4. git push — Upload to GitHub

5. git pull — Download latest changes

3

Setting Up Your First Repository

bash
# Initialize a new repository
git init

# Configure your identity
git config user.name "Your Name"
git config user.email "your@email.com"
// ...
4

Reading List

  • [Git Basics](https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F)
  • [GitHub Guides](https://guides.github.com/)
  • [Pro Git Book](https://git-scm.com/book/en/v2)
5

Next Steps

Create a GitHub account and create your first repository. Push the HTML files you've created so far!

Comprehension check

Answer all 3 questions correctly to unlock Submit.

1Which command initializes a new Git repository?

2What does `git commit` do?

3Which command sends local commits to a remote?