Hello, DEV Community! I hope you're sitting comfortably because today, I'm going to change your Git workflow forever. And I promise, it's not in the "I just changed all the IDE settings while you were at lunch" kind of way. More like, "here's a superpower you didn't even know you could have" kind of way.
What's Up with Git?
Git is great. It's like that loyal old dog that fetches your slippers, your newspaper, and occasionally a live grenade. We've all had those days when switching between branches feels less like coding and more like playing minesweeper in a war zone. One wrong move and BOOM! There goes your uncommitted code.
Git Worktrees to the Rescue!
Now, what if I told you there's a way to juggle between branches like a pro without ever stepping on a landmine? No, I'm not talking about cloning the repo for every branch like a caveman. I'm talking about Git worktrees.
Git worktrees let you check out multiple branches at once in different directories. It's like having a parallel universe for each branch where you can tamper with the space-time continuum without affecting the others. But managing these universes manually is a task only suited for a tenured professor at Hogwarts.
Enter WorktreesNuts
To make your journey through the multiverse smooth, we've created WorktreesNuts, a VSCode extension. It's like having a tour guide who not only knows all the secret passageways but also carries your luggage.
Here's What It Does (Spoiler Alert: It's Awesome!)
- Worktree Switcheroo: With a fancy keyboard shortcut (Ctrl+Cmd+R), you can hop between worktrees like a quantum particle. Who needs quantum supremacy when you've got WorktreesNuts?
Go To File, But Better: The good old Command+P now only shows you files in the active worktree. It's like having GPS that doesn't lead you to a different continent.
Status Bar Show-off: Flaunt your active worktree with a status bar item that's as clear as a sunny day in the Sahara desert.
Efficient File Indexing: We've taught WorktreesNuts to read .gitignore and ignore files that you wouldn't touch with a ten-foot pole.
Worktree Management: 🔜 With WorktreesNuts, you willbe able to create and delete worktrees without opening the terminal. It's as magical as it sounds.
Here's how it works
Get It Now!
WorktreesNuts is the VSCode extension you didn't know you needed. It makes Git worktrees work for you. It's like having your cake and eating it too, except the cake is your code, and you don't have to worry about the calories.
Open Source Because Sharing is Caring
We're sharing WorktreesNuts with the world, and we're eager for you to make it even better. You can find us on GitHub here. Contribute, criticize, or just drop by to say hi!
I hope you love using WorktreesNuts as much as we loved making it. Give it a try, and let us know what you think. Remember, in the world of Git worktrees, you're only as nuts as your tools.
So, hop on, strap in, and let's make Git worktrees cool again! And remember, with WorktreesNuts, the only thing you'll regret is that you didn't find it sooner.
Happy coding!
Top comments (6)
Anyone looking for a better experience than this with work trees should checkout
github.com/CodeInKlingon/vscode-gi...
Provides a sidebar with a list of worktrees and actions you can take on them. Much easier than the command palette approach
Cool stuff man! Does it open in the same window for me to be able to browse through files in different branches? Haven't tested it but I'll give it a shot
This is really cool!
Glad you liked it 🤌🏼😄
This is awesome!! ❤️
Thank you!