Skip to main content

Command Palette

Search for a command to run...

GitHub Basic For The Beginner

Published
2 min readView as Markdown

Introduction

If you are a beginner in coding, you must have heard about GitHub. Many students confuse Git and GitHub, but don’t worry—this blog will make it very simple.
Simple words mein: GitHub ek platform hai jaha hum apna code online store kar sakte hain, share kar sakte hain, aur team ke sath collaborate kar sakte hain.

Jab bhi aap project me change karte ho (new feature, bug fix, etc.) Git usko track karta hai and later you can:

A ] Old version pe wapas ja sakte ho B ] Team ke saath collaborate kar sakte ho C ] Changes compare kar sakte ho

# Why Git is Used?

1. Version Control 2. Collaboration (Team Work) 3. Backup & Safety 4. Branching & Experiment

#Git Basics and Core Terminologies

1 ] Repository (Repo) —→ Repo matlab project folder jisme .git hidden folder hota hai.
Ye Git ka database hota hai.

2 ] Commit —→ Commit = snapshot of your code at a particular time.
Har commit ke saath message hota hai. Ex . "Add login page" "Fix navbar bug"

3 ] Branch —→ Branch = parallel line of development. Ex . main branch = main project

4 ] HEAD —→ HEAD ek pointer hai jo batata hai ki currently aap kis commit/branch pe ho. in simple word HEAD = current position

#Common Git Commands

1) Git Version Check ——→ git --version 2) Set Username & Email (First Time Only) ——→ git config --global user.name , git config --global user.ema 3) Initialize Repository ——→ git init 4) Check Status ——→ git status 5) Commit Changes ——→ git commit -m "Your commit message" 6) View Commit History ——→ git log --oneline 7) Connect to GitHub (Remote) ——→ git remote add origin 8) Push Code to GitHub ——→ git push -u origin main 9) Pull Latest Changes ——→ git pull 10) Clone Repository (GitHub se download) ——→ git clone

#Flowchart : Basic Real Developer Workflow

Write / Edit Code —> git status —> git add . —> git commit -m "msg" —>git push.