Skip to content

Latest commit

 

History

History
114 lines (67 loc) · 2.62 KB

File metadata and controls

114 lines (67 loc) · 2.62 KB

⚙️ First-Time Git Setup


🎯 Goal

Configure Git so your commits have identity.


🧠 Why This Matters

Every commit in Git stores:

  • author name
  • email
  • timestamp

Without setup → commits are incomplete or incorrect.


✅ Basic Setup Commands

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

🧪 Verify Setup

git config --list

📸 Visual (Config Flow)

Image

Image

Image

Image

Image

Image


🏗 Internal Architecture

Git stores config in 3 levels:

1. System Level

/etc/gitconfig

2. Global Level (most common)

~/.gitconfig

3. Local Level (per repo)

.git/config

🔬 Example .gitconfig

[user]
    name = Your Name
    email = your@email.com

🧠 Priority Order

Local > Global > System

👉 Local overrides global


⚠️ Common Mistakes

  • forgetting to set email
  • wrong identity in commits
  • mixing work & personal emails

🧠 Memory Trick

Config = identity for commits


➡️ Next Step

👉 06-git-init.md