Welcome to Git, a powerful version control system that every developer should have in their toolkit. If you're new to Git, don't worry, by the end of this tutorial, you'll be well on your way to understanding its core concepts and operations. Let's dive right in!

Git is like a time machine for your code. It allows you to track changes, collaborate with other developers, and revert back to previous states if you ever need to. So, buckle up and let's learn how to use it effectively.

Familiarizing Yourself with Git
Before we jump into the commands, let's familiarize ourselves with Git's basic structure. Git keeps track of everything in a directory called .git. You can peek inside this directory, but you shouldn't need to โ most interactions with Git happen from outside this directory.

Now, let's move on to the fun part: using Git!
Setting Up Git

First things first, you need to set up Git. On your terminal, run these commands:
git config --global user.name "Your Name"
git config --global user.email your.email@example.com
These commands set your name and email, which Git will use for commits.
Initializing a Git Repository

Now, let's initialize a new Git repository. Navigate to your project directory and type:
git init
This command initializes a new Git repository in the current directory. You'll know it's been set up when you see a new .git directory in your project.
Staging and Committing Changes

With Git, you don't commit files willy-nilly. Instead, you stage changes and then commit them. Think of it like a digital package. You put items in the package ( staging), then send it off (commit).
Let's say you've just written an amazing function. Git doesn't know that yet, so you'll need to add it.




















Adding Changes to the Staging Area
To add a file to Git's staging area, use the `git add` command:
git add your_file.py
This command takes your file and puts it in the staging area. You can also add all changes with `git add .`.
Committing Changes
After you've staged your changes, it's time to commit them. Use the `git commit` command:
git commit -m "Your commit message here."
Replace "Your commit message here." with a brief description of what you've just committed.
Viewing Your Git History
Git keeps track of every commit, allowing you to look back at your project's history. Use `git log` to view your commit history:
git log
You'll see something like this:
commit 6bc979eea451b468936d2e89148ee5 csoportgdmn
ะฟัะตะด bastard@kubthuedeey
Fix a bug in the sorting algorithm