Cleaned up every Git branch in one PowerShell command today 🚀 git branch | Select-String -NotMatch 'main|master' | ForEach-Object { git branch -D $_.ToString().Trim() }; git branch -r | Select-String -NotMatch 'origin/main|origin/master' | ForEach-Object { git push origin --delete ($_.ToString().Trim() -replace '^origin/') } What it does: • Deletes all local branches except main and master • Deletes all remote branches except origin/main and origin/master Perfect when your repo is full of old feature branches and you want a fresh start. ⚠️ Be careful: this permanently removes branches, so make sure you don’t need any unmerged work before running it. #Git #PowerShell #DevTips #Programming #SoftwareEngineering #WebDevelopment #BMT #BmtMohammedTaha
Delete Unwanted Git Branches with PowerShell
More Relevant Posts
-
In Git, the small things matter more than you think. One wrong command — and you've overwritten someone's work, wiped your own history, or pushed something that should never have left your machine. It's not always the big decisions that break a project. Sometimes it's just: → using git reset --hard when you meant --soft → force pushing to main without thinking → not knowing git cherry-pick exists when you needed it most I put together a simple, no-fluff Git command reference — every command explained with when to use it, not just what it does. I've also modified and shared it here so it's easy to read and quick to refer back to whenever you feel stuck, AMEN 📎 https://lnkd.in/dr2YvYPb #Git #GitHub #VersionControl #Developer #SoftwareDevelopment #CodingTips #Programming
To view or add a comment, sign in
-
-
🧑💻 If you're learning Git, you don't need to memorize 200 commands. You just need these 10. I put together a quick visual reference covering the commands every developer uses daily: ① git init — start a new repo ② git clone — copy a remote repo ③ git status — see what's changed ④ git add — stage your files ⑤ git commit — save a snapshot ⑥ git push — send to remote ⑦ git pull — sync from remote ⑧ git branch — create a new branch ⑨ git checkout — switch branches ⑩ git merge — combine branches Master these and you'll handle 90% of your daily workflow with confidence. Save this for the next time you go blank staring at the terminal. 💾 #Git #VersionControl #Developer #Programming #100DaysOfCode #WebDevelopment #TechTips
To view or add a comment, sign in
-
-
Memorizing Git commands can be tricky, especially when you need to "Undo" a mistake under pressure. 😅 To make things easier, I’ve put together this cheat sheet of 25 must-know Git commands that I use daily. It covers everything from basic workflow to lifesavers like git stash pop, hard reset, and rebase. Whether you are setting up a new repo or fixing a botched commit, this guide has you covered. What's inside? 🔹 Basic Setup & Daily Workflow 🔹 Branch Management 🔹 Remote Operations 🔹 Advanced Fixes & Undo Commands Save this post for your next debugging session! 📌 What is your most-used Git command? Let me know in the comments! 👇 #Git #VersionControl #WebDevelopment #SoftwareEngineering #CodingTips #Programming #FullStack #DevOps #TechCommunity
To view or add a comment, sign in
-
-
💡 Want to improve your Git & GitHub skills? 1️⃣ Learn basic commands: add, commit, push, pull 2️⃣ Understand branching & merging clearly 3️⃣ Contribute to open-source projects 4️⃣ Keep your projects organized with good README files 5️⃣ Practice version control in every project Git is not optional — it’s essential ⚡ #Git #GitHub #VersionControl #Developers #OpenSource
To view or add a comment, sign in
-
Master Git & GitHub: From Zero to Hero! Ever felt lost in a sea of terminal commands? Whether you are just starting your coding journey or you're a seasoned dev, having a solid grasp of Git is non-negotiable. I’ve put together a comprehensive "Cheat Sheet" banner covering everything from basic initialization to advanced debugging like cherry-pick and bisect. What's inside: ✅ Basics: init, clone, add, commit ✅ Workflow: branch, push, pull ✅ Collaboration: merge, rebase, fork ✅ Advanced: stash, revert, reflog Save this post for your next "Merge Conflict" emergency! 🚩 #Git #GitHub #Programming #WebDevelopment #SoftwareEngineering #CodingTips #OpenSource
To view or add a comment, sign in
-
-
🚀💻 The Ultimate Git Cheat Sheet: From Beginner → Intermediate → Advanced Whether you're writing your first commit or managing complex workflows, Git is a non-negotiable skill for every developer. 🔰 Beginner: Master the basics — init, clone, add, commit, push ⚙️ Intermediate: Work smarter — branching, merging, rebasing 🔥 Advanced: Gain control — cherry-pick, stash, reflog, bisect, and more 💡 Git isn’t just version control—it’s your safety net, collaboration engine, and productivity booster all in one. The better you understand Git, the more confident and efficient you become as a developer. 👉 So tell me—what’s that one Git command you use almost daily? #Git #GitHub #VersionControl #Developers #Programming #Coding #SoftwareDevelopment #DevOps #Linux #Tech #DeveloperTools #LearnToCode #CodeNewbie #Backend #Frontend #FullStack #JavaScript #Python #Java #OpenSource #TechCommunity #Engineering #Productivity #Workflow 🚀
To view or add a comment, sign in
-
-
Mastering Git is a superpower for any developer. 🚀 If you find yourself constantly Googling the difference between git fetch and git pull, or forgetting the syntax for branching, I’ve got you covered. Here is a handy cheat sheet of the 12 most common Git commands you need for your daily workflow. Keep this saved as a quick reference guide next time you are pushing code or navigating a complex merge. What is the one Git command you always have to double-check? #Git #VersionControl #Programming #ITEngineering #DeveloperTools #TechTips #GitHub
To view or add a comment, sign in
-
-
Many times while working on projects, we open CMD, PowerShell, or Git Bash… and suddenly forget the most basic commands. Things like: cd .. ls mkdir pwd rm clear These commands are simple, but they are used almost daily in development. So I created a small 2-page PDF cheat sheet containing the most important basic terminal commands for: CMD PowerShell Git Bash If you're a beginner in coding, Git, or development, this will save you time and confusion. Download the PDF, keep it saved, and try practicing these commands once. It will make your workflow faster and more confident. #Git #GitBash #PowerShell #CMD #Terminal #Developer #Programming #Coding #SoftwareDevelopment #Learning #ComputerScience #Tech #Beginners #Productivity
To view or add a comment, sign in
-
🚀 Git Confused by Git? Not Anymore. Whether you're a beginner or a seasoned dev, there's always that one Git command you blank on at the worst moment. We've put together a Git Commands Cheat Sheet covering everything you need — from initializing a repo to resolving merge conflicts — all in one place. 📌 Save this. You'll thank yourself later. What's inside: ✅ Init & Clone ✅ Staging & Commits ✅ Branching & Merging ✅ Remote Commands ✅ Undoing Changes Whether you're pushing your first commit or managing complex branching strategies — this one's for you. 💻 Drop a 🙋 in the comments if you've ever typed git status just to feel in control. We've all been there. ♻️ Repost if this helped someone on your network! #Git #GitCommands #VersionControl #Developer #SoftwareEngineering #CodeNewbie #Programming #DevTools #100DaysOfCode #TechTips #OpenSource #WebDevelopment #LearnToCode #CodingLife #TechCommunity
To view or add a comment, sign in
-
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