Top community members
All Wiki Articles Create Wiki Article

Many years me and my friends we were volunteers on my university doing programming classes for young people.

I got main conclusion: Young people are awesome, especially students, because they always bring new and fresh ideas :)
* I loved to do it but my time is limited

  I decided to create something that will help millions of students

Now I am here


Git - remove all local branches that are not master branch

0 contributions
4 points

To remove all local branches that are not master brach execute following code:

git checkout master && git branch | grep -v master | xargs git branch -D && git remote update --prune


  • git checkout master
    switches to master branch,
  • git branch
    lists all local branches
  • grep -v master
    filters list returning all non master braches
  • xargs git branch -D
    deletes with force all local branches passing as arguments for git branch -D result from grep -v master (it is like: git branch -D local_branch_1 local_branch_2 local_branch_3 etc.),
  • git remote update --prune
    updates repository removing locally unused informations about remote-tracking branch names that do not correspond to remote repository.
0 contributions

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey ūüĎč
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more