Master Git in 15 Commands: Essential Git Usage for Developers

✨ 𝓖𝓲𝓽 𝓠𝓾𝓲𝓬𝓴 𝓝𝓸𝓽𝓮𝓼 — 𝓕𝓸𝓻 𝓘𝓷𝓽𝓮𝓻𝓿𝓲𝓮𝔀 & 𝓓𝓪𝓲𝓵𝔂 𝓤𝓼𝓮 ✨ 💡 𝓟𝓻𝓸 𝓣𝓲𝓹: Master these 15–20 commands = 90% of real-world Git usage 🔹 𝓖𝓲𝓽 𝓑𝓪𝓼𝓲𝓬𝓼 • Git → Version control system (tracks code changes) • GitHub → Cloud platform for Git collaboration 🔹 𝓤𝓼𝓮𝓻 𝓒𝓸𝓷𝓯𝓲𝓰 git config --global user.name "Abhishek Keshari" git config --global user.email "abhishek@keshari.com" git config --list git config user.name 🔹 𝓘𝓷𝓲𝓽 & 𝓗𝓮𝓵𝓹 git init → Initialize repo git help → Help docs git ls → List files (use: ls in terminal) 🔹 𝓢𝓽𝓪𝓰𝓲𝓷𝓰 git add . → Add all files git add fileName.ext → Add specific file 🔹 𝓒𝓸𝓶𝓶𝓲𝓽 git commit -m "message" 🔹 𝓢𝓽𝓪𝓽𝓾𝓼 & 𝓛𝓸𝓰 git status → Check changes git log → Commit history git log --author="Abhishek" 🔹 𝓓𝓲𝓯𝓯 git diff → Working vs repo git diff --staged → Staging vs repo 🔹 𝓕𝓲𝓵𝓮 𝓞𝓹𝓼 git rm file.ext → Delete file git mv old.txt new.txt → Rename git mv file.txt folder/file.txt → Move 🔹 𝓤𝓷𝓭𝓸 & 𝓡𝓮𝓬𝓸𝓿𝓮𝓻 git reset HEAD file.ext → Unstage file git checkout file.ext → Restore file git checkout commitId → Go to old version git checkout commitId -- file.ext → Restore specific file 🔹 𝓡𝓮𝓶𝓸𝓽𝓮 𝓡𝓮𝓹𝓸 git remote add origin <repoURL> git remote → List remotes 🔹 𝓟𝓾𝓼𝓱 git push -u origin branchName 🔹 𝓒𝓸𝓷𝓬𝓮𝓹𝓽𝓼 • Fork → Copy someone else's repo • Issues → Track bugs/tasks • .gitignore → Ignore files (node_modules, logs, etc.) #Git #GitHub #Developers #InterviewPrep #FullStack #JavaDeveloper #TechNotes

To view or add a comment, sign in

Explore content categories