TGViewer
Web Development Web Development @web_dev_bds Β· 4.43K subscribers
Post #715 770
βœ… Git Basics You Should Know πŸ› οΈπŸ“

Git is a version control system used to track changes in your code, collaborate with others, and manage project history efficiently.

1️⃣ What is Git?
Git lets you save snapshots of your code, go back to previous versions, and collaborate with teams without overwriting each other’s work. πŸ“Έ

2️⃣ Install & Setup Git
git --version # Check if Git is installed
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

3️⃣ Initialize a Repository
git init # Start a new local Git repo πŸš€

4️⃣ Basic Workflow
git add . # Stage all changes βž•
git commit -m "Message" # Save a snapshot πŸ’Ύ
git push # Push to remote (like GitHub) ☁️

5️⃣ Check Status & History
git status # See current changes 🚦
git log # View commit history πŸ“œ

6️⃣ Clone a Repo
git clone https://github.com/username/repo.git πŸ‘―

7️⃣ Branching
git branch feature-x # Create a branch 🌳
git checkout feature-x # Switch to it ↔️
git merge feature-x # Merge with main branch 🀝

8️⃣ Undo Mistakes ↩️
git checkout -- file.txt # Discard changes
git reset HEAD~1 # Undo last commit (local)
git revert <commit_id> # Revert commit (safe)

9️⃣ Working with GitHub
– Create repo on GitHub ✨
– Link local repo:
git remote add origin <repo_url>
git push -u origin main

πŸ”Ÿ Git Best Practices
– Commit often with clear messages βœ…
– Use branches for features/bugs πŸ’‘
– Pull before push πŸ”„
– Never commit sensitive data πŸ”’

πŸ’‘ Tip: Use GitHub Desktop or VS Code Git UI if CLI feels hard at first.

πŸ’¬ Tap ❀️ for more!
  • ❀ 3
More from @web_dev_bds
  1. Oct 16, 2026πŸ“•Random React Tip: If you want to quickly log things from JSX (we've all been there), you…
  2. Oct 15, 2026Websites to Learn Every Technology
  3. Oct 13, 2026Docker vs Kubernetes
  4. Oct 12, 2026Post #1054
  5. Oct 11, 2026CSS Tip Stop centring tooltips with πšπš›πšŠπš—πšœπš•πšŠπšπšŽ: -𝟻𝟢%. near the edge of the scree…
  6. Oct 9, 2026JavaScript CheatSheet
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’