Thursday, March 6, 2025

2️⃣ Git Basics

 

2️⃣ Git Basics

Before diving deep into Git, let's set up everything correctly and understand the fundamental concepts.



🌍 Shape Your Future with AI & Infinite Knowledge...!!

🌐 Want to Generate Text-to-Voice, Images & Videos? 👉 http://www.ai.skyinfinitetech.com 📚 Read In-Depth Tech & Self-Improvement Blogs 👉 http://www.skyinfinitetech.com ▶ Watch Life-Changing Videos on YouTube 👉 https://www.youtube.com/@SkyInfinite-Learning 🔥 Transform Your Skills, Business & Productivity – Join Us Today! 🔥



🔹 Installing Git (Windows, Mac, Linux)

Before using Git, you need to install it on your system.

🖥️ Installing Git on Windows:

  1. Download Git from git-scm.com.
  2. Run the installer and select default settings.
  3. Verify installation: Open Command Prompt and run:

    git --version

🍎 Installing Git on macOS:

  1. Open Terminal and run:

    brew install git
  2. Verify installation:

    git --version

🐧 Installing Git on Linux (Ubuntu/Debian):

  1. Open Terminal and run:

    sudo apt update && sudo apt install git
  2. Verify installation:

    git --version


🔹 Configuring Git (User Name, Email, Editor)

Before using Git, set your identity (username & email), as it will be associated with every commit.


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

To check your configuration:


git config --list


🔹 Git Lifecycle (Working Directory → Staging Area → Repository)

Git has a three-stage process for managing files:

1️⃣ Working Directory: Where you create or modify files.
2️⃣ Staging Area: A temporary space where changes are added before committing.
3️⃣ Repository: The final stored version after committing the changes.


🔹 Example Workflow:


git add filename # Moves file to staging area git commit -m "Your commit message" # Saves the changes permanently git push origin main # Uploads the changes to remote repository


🔹 First-Time Git Setup

After installing Git, configure the default editor and enable colored output:


git config --global core.editor "vim" # Set default editor to Vim git config --global color.ui auto # Enable color in Git output






📚 Top 5 Books That Will Change Your Life!(Top 5 Life-Changing Books) 🚀


1️⃣ Atomic Habits – Build powerful habits and break bad ones!

👉 Get it here: https://amzn.to/4ka28CJ

2️⃣ The Psychology of Money – Master your financial mindset!

👉 Get it here: https://amzn.to/3XiKFOA

3️⃣ Think and Grow Rich – Unlock the secrets to wealth and success!

👉 Buy now: https://amzn.to/4h51HGN

4️⃣ The Power of Your Subconscious Mind – Train your mind for success!

👉 Get it here: https://amzn.to/4idNPuR

5️⃣ Rich Dad Poor Dad – Learn financial lessons the rich teach their kids!

👉 Order here: https://amzn.to/3QzrmNa

No comments:

Post a Comment

Terraform State Deep Dive: Why it's Crucial and How to Manage It

Terraform State Deep Dive: Why it's Crucial and How to Manage It ...