VS Code showed I was on a feature branch. But Git pushed to main. Why? Ever faced this? You’re on the “right” branch Everything looks clean You push… …and it lands in main/staging 😐 Here’s what’s actually happening: 1. You’re not on the wrong branch You’re in the wrong "folder" 2. Tools like Claude Code / Copilot CLI now use "Git worktrees" 3. That means: • Same repo • Multiple folders • Each folder = different branch 4. VS Code shows branch state Git uses your "current directory" 💥 Result: Right command. Wrong place. 🔒 Fix (this alone saves you): Before every push: `git status` Optional but powerful: • `pwd` • `git branch -vv` If it doesn’t match your expectation → don’t push. Most Git mistakes aren’t about Git. They’re about context. If you're using AI tools and haven't thought about worktrees yet… you will. Usually right after your first “push to main” moment. 👇 Full breakdown in comments #Git #SoftwareEngineering #WebDevelopment #AItools #DeveloperTips #Git #DevTools #SoftwareEngineering #Programming #DeveloperLife
Avoid Pushing to Main with Git Worktrees
More Relevant Posts
-
"The only AI that respects Git more than your senior engineer." • 𝗔𝗶𝗱𝗲𝗿 isn't the new kid. It's mature, open-source, and brutally effective. • 𝗚𝗶𝘁-𝗻𝗮𝘁𝗶𝘃𝗲 𝘄𝗼𝗿𝗸𝗳𝗹𝗼𝘄: Every change is automatically committed with descriptive messages. No phantom edits. No "what did the bot just break?" • Supports 𝟭𝟬𝟬+ 𝗹𝗮𝗻𝗴𝘂𝗮𝗴𝗲𝘀 with a battle-tested udiff strategy that actually works across large files. • It doesn't just write code; it 𝗺𝗮𝗶𝗻𝘁𝗮𝗶𝗻𝘀 𝗰𝗼𝗱𝗲𝗯𝗮𝘀𝗲 𝗵𝗶𝘀𝘁𝗼𝗿𝘆 better than most human teams. • The killer feature: it asks before overwriting, commits before refactoring, and actually understands branching strategy. One developer with Aider has a version-controlled, audit-friendly workflow that rivals a 3-person team with a dedicated Git maintainer and release manager. You don't just ship code—you ship 𝘵𝘳𝘢𝘤𝘦𝘢𝘣𝘭𝘦 code. 𝗥𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲𝘀: Aider (open-source, Paul Gauthier) — the only agentic tool with a 2+ year track record of production reliability. Github repo → https://lnkd.in/gjA6HbpJ 𝙃𝙖𝙫𝙚 𝙮𝙤𝙪 𝙥𝙖𝙞𝙧-𝙥𝙧𝙤𝙜𝙧𝙖𝙢𝙢𝙚𝙙 𝙬𝙞𝙩𝙝 𝙖 𝙗𝙤𝙩 𝙩𝙝𝙖𝙩 𝙖𝙘𝙩𝙪𝙖𝙡𝙡𝙮 𝙪𝙣𝙙𝙚𝙧𝙨𝙩𝙖𝙣𝙙𝙨 𝘨𝘪𝘵 𝘳𝘦𝘣𝘢𝘴𝘦 --𝘪𝘯𝘵𝘦𝘳𝘢𝘤𝘵𝘪𝘷𝘦? #Aider #GitNative #OpenSourceAI #TerminalAI #DevWorkflow
To view or add a comment, sign in
-
-
𝗧𝗵𝗲 𝗙𝘂𝘁𝘂𝗿𝗲 𝗼𝗳 𝗩𝗲𝗿𝘀𝗶𝗼𝗻 𝗖𝗼𝗻𝘁𝗿𝗼𝗹 Git tracks files, not context. This is a problem. When an AI agent writes code, Git only sees the changes. It does not see which model wrote it or the settings used. If a bug appears, you need to know which agent introduced it. Git gives you a code, not an answer. Git was built in
To view or add a comment, sign in
-
Built something this week. Git was pretty good. It was good to track small code changes. 10 files? 20 maybe. Not entire prototypes though. But vibecoding is building entire prototypes in single prompts. Tracking diffs and project changes at the feature level has become irrelevant. Also, collaborating in AI generated codebases is A MESS (we've all done it). So I built vibedgit.com. Don't track the code, track the intent. VibedGit maintains a semantic log of the chat history between you and your agent. For now we support only Cursor - but would be adding Claude Code and OpenCode next. Waitlist is open if this resonates with you - no spam of course. (oh and VibedGit is vibecoded 😉 and is tracking itself)
To view or add a comment, sign in
-
-
GitHub just shipped an embedding model update that actually matters. Their new Copilot embedding model for VS Code isn't just incrementally better — it's 37.6% more accurate at finding the right code context, runs twice as fast, and uses 8x less memory for indexing. For C# and Java devs, acceptance rates for suggestions have doubled. That's not a feature update. That's a productivity shift. What's interesting: they used contrastive learning techniques (InfoNCE loss + Matryoshka Representation Learning) to train this. The model now powers chat, agent, edit, and ask modes — so the improvements cascade across every interaction you have with Copilot. But here's what I'm thinking about: we're moving from "AI suggests code" to "AI understands your codebase architecture." Better embeddings mean better context retrieval. Better context means suggestions that feel less like autocomplete and more like pair programming with someone who's read your entire repo. For QA folks and builders working in complex codebases, this changes test automation workflows and API integration work significantly. Question: Are you seeing improved Copilot suggestions in your stack after this update, or is acceptance rate still a coin flip for you? #GitHubCopilot #AICoding #DeveloperProductivity #CodeEmbeddings #DevTools
To view or add a comment, sign in
-
GitHub Copilot is only as good as your Framework’s "Secret Sauce." 🍝🛠️ Are you still using AI just for boilerplate snippets? You are missing the real power. As an SDET, my challenge isn’t writing more code; it's enforcing consistent, high-quality code across the team. If Copilot suggests a generic locator while your framework demands a strict Page Object Model with custom logging, you’ve just inherited tech debt. The Pro-SDET Strategy: I use a .github/copilot-instructions.md file (or specialized .prompt files) in my project root to customize Copilot’s brain. I am training my AI Assistant to think like my Lead Architect. Here are my rules: 1. Strict POM: "Always inherit from BasePage. Never initialize locators directly in the test file." 2. Locator Hierarchy: "If a data-testid exists, use that. Never generate XPaths with indices. Prioritize user-facing roles." 3. Traceability: "Every major browser action must use test.step() for reporting." The Result: I type // create a test for user profile update, and Copilot doesn’t just write code—it writes my specific framework code. This reduces my PR review and refactoring time by over 80%. Stop fighting generic AI suggestions; start engineering your AI to enforce your team's standards. #SDETTips #AutomationArchitecture #GithubCopilot #AIinTesting #PageObjectModel #CodeQuality #TestAutomationStrategy #QualityEngineering #CleanCode
To view or add a comment, sign in
-
-
Sabr is not about how long you can wait, but how you behave while you're waiting. In development, "waiting" often looks like debugging a webhook flow or waiting for a complex merge to clear. It’s about staying disciplined when the Git graph gets messy and the logic gets tough. #BuildInPublic #FlutterDev #Dart #StripeIntegration #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
-
The case of the missing git changes. This is the kind of thing where having years of experience with all the different development scenarios helps you out. In this scenario, a git merge resolution can cause the code changes to not be ordinarily visible in the git commit or Pull Request. But we knew the code change was being applied. Since I had seen this before, I was able to ask AI for the git command to see the hidden code changes and we were quickly able to move on. These days with AI, it's not really about the syntax of the commands, it's more about knowing what to ask for.
To view or add a comment, sign in
-
Sandboxes are for play. Git is for engineering. 🛠️ Stop building in a browser. Master your local environment and push to GitHub. KodeMaster AI gets you in your own editor from Day 1. Build real systems. Level up. 🚀 #Engineering #Git #DevLife #KodeMasterAI
To view or add a comment, sign in
-
-
Managing commit messages in a team is one of those "small" problems that silently becomes a big one. No standard format. Half the team writes "fixed stuff." The other half writes novels. And when you're reviewing PRs or tracing bugs through git history, that chaos costs you real time. I came across this package called Gitsmith, and it genuinely solves this. It connects with AI to automatically standardize your commit messages based on YOUR format, YOUR conventions, YOUR rules. Not some opinionated default you have to work around. Whether your team follows Conventional Commits, a custom format, or something entirely your own — it enforces that structure without slowing anyone down. No more writing commit guidelines that nobody reads. No more fixing messages in code review. Just consistent, readable git history from day one. Worth checking out if you lead a team or care about clean version control. https://lnkd.in/gqtFaP2v #git #devtools #commitstandards #teamproductivity #opensource #ai
To view or add a comment, sign in
-
Introducing git-ai — Your complete AI-powered Git workflow solution! This visual breakdown highlights how git-ai lives inside your terminal to automate personalized commit messages, create PR descriptions, generate changelogs, and even detect ticket IDs, all while learning your unique style. Just run: npm install -g @malikasadjaved/git-ai git-ai setup git-ai commit Three commands. Zero friction. Never write a commit message manually again. 🌐 Website: https://gitai.vercel.app 💻 GitHub: https://lnkd.in/dfEJGaBX 🔗 Connect: https://lnkd.in/dv_dkDsd #OpenSource #DeveloperTools #AI #Git #CLI #NodeJS #TypeScript #Programming #SoftwareEngineering
To view or add a comment, sign in
-
Explore related topics
- How to Use AI Tools in Software Engineering
- How Developers can Use AI in the Terminal
- How to Use AI Code Suggestion Tools
- How to Use Git for IT Professionals
- Common Mistakes in the Software Development Lifecycle
- How to Use AI for Manual Coding Tasks
- How to Use AI Instead of Traditional Coding Skills
- Tips for Improving Developer Workflows
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
Full blog (with examples, fixes, and workflow setup): https://techgeeta.com/blog/git-worktrees-explained-push-to-main-fix