Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
606 views
by The go-to Tester (142 points)
edited by
I have got many unused git branches on my local machine. How do I delete those?

There are many branches on my machine and it will be difficult to delete it one by one. So, was wondering if we can have a single line of code that can help me delete unused branches. Or a set of branches that have not been used for last 1 week.

5 Answers

0 like 0 dislike
by
Use the git prune command
0 like 0 dislike
by
git branch -D branchname
by The go-to Tester (142 points)
There are many branches on my machine and it will be difficult to delete it one by one. So, was wondering if we can have a single line of code that can help me delete unused branches. Or a set of branches that have not been used for last 1 week.
0 like 0 dislike
by Contributing Tester (12 points)
git branch -D OP-5510
0 like 0 dislike
by
git branch -D <branch name>
0 like 0 dislike
by Contributing Tester (12 points)
There are no such single line command to delete unused branches that has no commit from last 1 week. You have to delete branch one by one by giving branch name or use source control tools like tortoise git


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...