DEV Community

Discussion on: How to delete all your local branches but keep master

Collapse
 
vnglst profile image
Koen van Gilst

And on Windows? 😢

Collapse
 
adilfulara profile image
Adil Fulara

Use Linux subsystem 😂

Collapse
 
vnglst profile image
Koen van Gilst

Blocked by the corporate proxy 😢😤

Thread Thread
 
lesha profile image
lesha 🟨⬛️ • Edited

Why though, shouldn't all developers have local admin on workstations?

Or at the very least, shouldn't you be able to request a change in these policies for work-related purposes?

Thread Thread
 
vnglst profile image
Koen van Gilst

currently downloading using the Microsoft store is blocked by the corporate proxy, but maybe there are other ways to get the Linux Subsystem up and running?

Thread Thread
 
david_j_eddy profile image
David J Eddy

Set up a forwarder when at home; use it from the office. :)

Collapse
 
lesha profile image
lesha 🟨⬛️

Git-scm?

Collapse
 
kubadlo profile image
Jakub Leško • Edited

PowerShell in Windows has slightly different syntax, but you can achieve the same result with the line below :)

git branch | Select-String -NotMatch -Pattern "master" | %{ git branch -D $_.ToString().Trim() }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
vnglst profile image
Koen van Gilst

Thanks, I should definitely look into Powershell a bit more (first time on a contract for a client with a Windows stack)

Collapse
 
lesha profile image
lesha 🟨⬛️

I mean, this is cool and all, but PS syntax is too explicit imo