Most developers use Git every day. But 90% only know 3 commands. Here's the complete cheat sheet they're missing. 😳 📌 Basics (jo sab ko pata hona chahiye) main → Default primary branch origin → Default upstream branch HEAD → Current branch pointer HEAD^ → Parent of HEAD HEAD~3 → Great grandparent of HEAD 🌿 Branches git branch --all → List all local and remote branches git checkout hotfix → Switch to existing branch git merge hotfix → Merge branch changes to main git log --graph --oneline → Visual branch history 🚀 Start to Work git init → Create a new local Git repo git clone → Copy a repo git pull → Fetch and update from remote git add [file] → Stage tracked/untracked files git commit → Save staged changes git push origin HEAD → Push local changes to origin ⚔️ Conflicts git diff → See specific local changes git diff --ours → Compare working tree with our branch git diff --theirs → Compare working tree with their branch 🛠️ Useful Tools git archive → Create a release tarball git cherry-pick [commit-id] → Pick any specific commit to your branch The 3 commands most developers don't use but should: → git log --graph --oneline → git cherry-pick → git diff --theirs Save this. Share with a junior dev who needs it. Follow Developers Street for more practical dev tips. 🌐 www.developersstreet.com 📞 +91 9412892908 . . . . #Git #GitHub #VersionControl #SoftwareEngineering #WebDevelopment #DevelopersStreet #CodingTips #TechCareers #FullStackDevelopment #DevOps
More Relevant Posts
-
Git Cheat Sheet Every Developer Should Save If you keep forgetting Git commands… you’re not alone. Git is powerful, but only if you understand the right commands at the right time. Here’s a structured cheat sheet you’ll actually use 👇 1. Setup & Configuration git config --global user.name → Set your name git config --global user.email → Set your email git config --global color.ui auto → Better CLI visibility 2. Initialize & Clone git init → Start a new repository git clone [url] → Copy an existing repo 3. Stage & Commit (Most Used) git status → Check changes git add [file] → Stage file git commit -m "message" → Save snapshot git diff → See unstaged changes git diff --staged → See staged changes 4. Branching & Merging git branch → List branches git branch [name] → Create branch git checkout [branch] → Switch branch git merge [branch] → Merge changes 5. Remote Operations git remote add [alias] [url] → Connect repo git push → Upload code git pull → Fetch + merge updates git fetch → Get updates without merging 6. Tracking Changes git log → View history git show [SHA] → View specific commit git diff branchA...branchB → Compare branches 7. Temporary Work (Stash) git stash → Save changes temporarily git stash pop → Restore changes git stash list → View saved states 8. Undo & Rewrite git reset --hard [commit] → Reset project git rebase [branch] → Reapply commits Git is not about memorizing commands. It’s about understanding when and why to use them. If you master these… you’ll handle 90% of real-world Git tasks confidently. Comment “GIT” if you want the full PDF cheat sheet. If this feels like your journey, you’re not alone. If you want to grow on LinkedIn, follow ❤️me Narendra Kushwaha. and DM me. I’ll guide you on the right path for 2026, based on my journey of building a 7K+ LinkedIn family in 7–8 months. #Git #VersionControl #Developers #Programming #SoftwareEngineering #Tech #CareerGrowth
To view or add a comment, sign in
-
Ever needed to switch branches… but your code isn’t ready to commit? 👀 That’s where git stash helps. It saves your current work (staged + modified tracked changes) and resets everything back to HEAD, so you can safely switch branches without committing incomplete code. Your stashes are stored like a stack (stash@{0} is the latest), and you can reuse them anytime. By default, only tracked files are saved: Add untracked files → git stash push -u Add ignored files → git stash push -a When you’re ready to continue: git stash apply → bring changes back (keep stash) git stash pop → bring changes + remove stash Need a specific one? git stash apply stash@{N} Want your staged changes back too? git stash apply --index git stash pop --index Manage everything easily: Save → git stash push -m "message" View → git stash list Inspect → git stash show -p stash@{N} Delete → git stash drop stash@{N} or git stash clear Think of it as putting your work on pause without losing a thing. 👉 Follow for more practical dev tips! #Git #GitHub #WebDevelopment #DevTips #Developers #Syncfusion
To view or add a comment, sign in
-
-
Essential Git Commands Every Developer Should Know (Practical Guide) Git is not just about add, commit, and push. Knowing the right commands helps you manage code, collaborate safely, and recover quickly from mistakes. ⸻ 📁 Repository Setup git init – Initialize a new repository git clone <repo_url> – Clone existing repository ⸻ 📌 Tracking Changes git status – Check current changes git add <file> / git add . – Stage changes ⸻ 💾 Committing git commit -m "message" – Save changes git commit --amend – Modify last commit ⸻ 🌿 Branching git branch – List branches git checkout -b <branch> – Create & switch git switch <branch> – Switch branch ⸻ 🔀 Merge / Rebase git merge <branch> – Merge branches git rebase <branch> – Clean commit history ⸻ 🚀 Remote git pull – Get latest changes git fetch – Fetch without merging git push origin <branch> – Push code ⸻ ⏪ Undo git restore <file> – Discard changes git reset <file> – Unstage git revert <commit> – Safe undo (recommended) ⸻ 🔍 History git log --oneline – View commits git diff – Check differences ⸻ 📦 Stash git stash – Save work temporarily git stash pop – Restore work ⸻ 🧩 Practical Scenario (Hotfix) git stash → git checkout main → git pull → git checkout -b hotfix/issue → fix → commit → git push ⸻ Key Takeaways • Prefer fetch before pull • Use revert instead of reset in shared branches • Keep commits small and meaningful • Always verify using status before pushing ⸻ Mastering Git is about using the right command at the right time. #Git #VersionControl #SoftwareEngineering #Developers #DevOps
To view or add a comment, sign in
-
🧠 TIL: git update-index --skip-worktree - a tiny git flag that made my dev loop so much cleaner. Every project has those files - the ones that are tracked in the repo, but you need to tweak locally just to get a sane dev experience. For me today, it was two BullMQ processor files that spin up cron jobs (heartbeats, cache clearers) on every boot. Great in staging/prod. Annoying as heck when I'm just trying to debug something unrelated on my laptop. The catch: they're tracked files. So .gitignore doesn't help. .git/info/exclude doesn't help. The moment I comment out a scheduler to quiet things down, my git status lights up - and one stray git add . away from shipping a broken commit. The usual workaround is stash / pop - and it's genuinely painful: Before every branch switch → git stash After switching → git stash pop Forget once → you lose your local tweaks or hit merge conflicts on your own stash Multiple local tweaks across multiple files = a growing stash stack you have to babysit git status still nags you until you stash And good luck if you want to commit other changes without accidentally including these One line fixes all of that: git update-index --skip-worktree path/to/file Now git pretends the file matches the index. No more noise in status, no accidental add, no stash dance. Your local edits just… stay local. Forever. Silently. Undo is equally simple, whenever you want: git update-index --no-skip-worktree path/to/file One caveat worth knowing: if upstream ever changes that file, you'll need to --no-skip-worktree, stash, pull, and re-flag. But for files that rarely change upstream, it's a massive quality-of-life win. If you've ever muttered "why is this file showing up in my diff AGAIN" - give this a try. 🙌 Found this via this great little writeup: https://lnkd.in/g_JqgPG7 #git #developerproductivity #softwareengineering #TIL
To view or add a comment, sign in
-
There's a specific kind of blank-stare moment many developers know. You open a project, something you cloned, something you built yourself last spring, and you just stare. The code is right there. The context is completely gone. I built a VS Code extension called Explain This Project to solve this. One command gives you structure analysis, dependency mapping, git diagnostics showing which files break the most, and a plain-text summary via Copilot. All in one file at your project root. I recently added git diagnostics after reading a great post by Ally Piechowski on the git commands she runs before reading any code. It clicked immediately. That belongs in the same file. You can read more about it here. https://lnkd.in/egGShAjQ
To view or add a comment, sign in
-
If you don’t know these Git & GitHub commands, you’re making development harder than it needs to be. → git init — start a repository → git add . — stage all changes → git commit -m "msg" — save changes → git status — check file state → git log --oneline — view history → git branch — list branches → git checkout -b <branch> — create + switch → git merge <branch> — merge changes → git remote add origin <url> — connect repo → git push origin — upload code → git pull origin — get updates → git clone <url> — copy repo → git revert HEAD — undo safely → git reset <id> — go back → git commit --amend — fix last commit ─────────────────── These are not “extra” commands. This is your daily workflow. And yes — this is exactly what gets asked in interviews. This PDF explains everything clearly: • How Git tracks changes • Staging → Commit → History • Branching & merging • Working with GitHub • Undoing mistakes properly Now the part that actually helps: • Don’t memorize — use Git daily • Understand reset vs revert (very important) • Write meaningful commit messages • Practice branching on small projects • Learn by breaking things & fixing them One simple test: If you can explain your Git workflow step-by-step… you’re already ahead of most candidates. Use this like a quick revision: Open → scan → recall → apply That’s all it takes. Save this — this is your 10-minute Git revision before interviews. Follow Sahil Hans for more practical dev, DSA & interview prep content 🤝
To view or add a comment, sign in
-
Blogged: New features in Git 2.54: easier rebasing, hooks, and statistics https://lnkd.in/exQMMKy8 In this post I show some of the new features in Git 2.54 including simple rebases with git history, config-based hooks, and stats with git repo structure #git
To view or add a comment, sign in
-
Git Commands I Use 99% of the Time as a Software Engineer (3+ Years Experience) These are the commands that actually matter in real-world development 👇 🔹 Daily Workflow 1. git status – Check current changes 2. git diff – See unstaged changes 3. git add <file> – Stage changes 4. git commit -m "message" – Save changes 5. git pull – Sync with remote 6. git push origin <branch> – Push changes 🔹 Branching 7. git switch -c <branch> – Create & switch branch (modern alternative to checkout) 8. git switch <branch> – Switch branch 9. git branch – List branches 10. git branch -D <branch> – Delete branch (force) 🔹 History & Debugging 11. git log --stat – View commit history 12. git show <commit> – Inspect a commit 13. git diff – Compare changes 🔹 Undo & Fixes 14. git commit --amend – Modify last commit 15. git reset HEAD~1 – Undo last commit (keep changes) 16. git revert <commit> – Safe undo via new commit 17. git reset --hard – ⚠️ Dangerous: wipes changes 🔹 Advanced 18. git rebase -i – Clean up commit history 19. git cherry-pick <commit> – Apply specific commit 20. git stash / git stash pop – Save work temporarily 21. git merge – Merge branches 🔹 Rare but Useful 22. git clone <repo> – Clone repository 23. git format-patch – Create patch 24. git apply – Apply patch 💡 Pro Tip: If you’re working in teams, prefer git revert over git reset for shared branches to avoid breaking history. #QA #SDET #SoftwareTesting #TestAutomation #ManualTesting #AutomationTesting #QALife #TestingCommunity
To view or add a comment, sign in
-
-
If you don’t know these Git & GitHub commands, you’re making development harder than it needs to be. → git init — start a repository → git add . — stage all changes → git commit -m "msg" — save changes → git status — check file state → git log --oneline — view history → git branch — list branches → git checkout -b <branch> — create + switch → git merge <branch> — merge changes → git remote add origin <url> — connect repo → git push origin — upload code → git pull origin — get updates → git clone <url> — copy repo → git revert HEAD — undo safely → git reset <id> — go back → git commit --amend — fix last commit ─────────────────── These are not “extra” commands. This is your daily workflow. And yes — this is exactly what gets asked in interviews. This PDF explains everything clearly: • How Git tracks changes • Staging → Commit → History • Branching & merging • Working with GitHub • Undoing mistakes properly Now the part that actually helps: • Don’t memorize — use Git daily • Understand reset vs revert (very important) • Write meaningful commit messages • Practice branching on small projects • Learn by breaking things & fixing them One simple test: If you can explain your Git workflow step-by-step… you’re already ahead of most candidates. Use this like a quick revision: Open → scan → recall → apply That’s all it takes. Save this — this is your 10-minute Git revision before interviews.
To view or add a comment, sign in
-
Git 2.54 just dropped, and it’s a massive upgrade for our daily development workflows. 🚀 I’ve been exploring the latest release, and here are the 4 standout features that are officially changing how I manage my repositories: ✨ git history: Finally, a surgical, opinionated way to rewrite commit history. No more interactive rebases for simple typos or commit splits. ⚙️ Config-based hooks: Forget copying bash scripts into every .git/hooks folder. You can now manage hooks globally via your .gitconfig with local opt-outs. It’s clean, shareable, and scalable. 📈 Geometric Compaction: The new default maintenance strategy. It’s smarter, faster, and prioritizes daily performance over monolithic garbage collection. If you work in monorepos, this is a game-changer. 📊 git repo structure: Time to retire git-sizer. We now have native, detailed observability into our repository’s health—from commit depth to identifying the exact blobs bloating our disk space. Git 2.54 is a huge win for developer experience. If you’re looking to clean up your history, automate your quality checks, and keep your repos performant, it’s time to upgrade your git. #Git #DevOps #GitHub #SoftwareEngineering Read my deep dive into these Git features here -
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development