From time to time we all get annoyed by the git branch autocomplete, which used to be so useful, but now makes us practically write the whole branch name! 😡
Why it keeps happening? Because we are awesome developers who use feature branch flow and now, after working so hard, we have dozens of branches on our local machine.
Yogo, can you tell me an easy way to clear these branches? I don’t wanna delete each one manually! 😩
I sure can, my friend! Here is an alias that I use to delete all my merged branches:
alias clear_merged_branches="git branch --merged | egrep -v '(^\*|master|production)' | xargs git branch -d"
It will only leave the “master” and “production” branches, which you can easily change on that code. Besides the branches that haven’t been merged into master, of course.
Remember to use this alias while you are on the “master” branch 😉
As lpmusix pointed out, you can also use it as a git alias. Add to the alias section of your
cb = "!git branch --merged | egrep -v '(^\\*|master|production)' | xargs git branch -d"
Justin Jackson started the Mega Maker Challenge a week ago and I joined right away:
The new year is here. How can you make this year better than the last? For me the answer is to create new things. I don’t want to “just be a consumer.” Making things, and releasing them to the world, gives my life purpose.
This year, I’m challenging myself to make 100 things. Want to join me?
I sure want! And you can as well. As he says, you don’t need to create 100 things, you can challenge yourself to create as many as you want.
He even created a newsletter with good insights to help you conquer this challenge. Join the challenge and let’s make all the things!
A week ago I was trying to find some algorithm exercises and I found exercism.io, a website that helps you practice your developer skills using your terminal, your favorite IDE and TDD 🙂
Besides the TDD approach, what I really liked about it is that it encourages you to solve problems iteratively, one test at a time and when all tests are passing, refactor your code for a better solution.
It also lets you discuss each others solutions and I’ve already received some nice advices. Some exercises also made me learn some new methods that I’ve never used before like reduce/ tr and learn that count can receive a block!
I suggest you try it and then let me know if you liked it or not and if you did, comment here your profile so we can try to help you improve your coding skills 🙂
ps: you can also see my answers and help me improve mine