• TIL: Efficient Sorting of Git Branches

    In Git, branches are sorted alphabetically by default. This is convenient when you remember the branch name, but it's not always the most practical approach. Fortunately, the sorting order can be customized to display branches with the latest changes first:

    git branch --sort=-committerdate

    Optionally, -r can be added to search for a remote branch. This is particularly useful when looking for a branch previously worked on with a teammate.

    I have set this as the default in my personal .gitconfig:

    [branch]
        sort = -committerdate
  • Cleaning Up Local Git Branches

    Over time, I accumulate several local Git branches in various projects. To maintain clarity, I regularly delete all branches except the main branch.

    To avoid having to constantly search for the command, I'd like to share it with you here:

    git branch | grep -v "main" | xargs git branch -d

    git branch lists all local branches. grep -v "main" filters out the main branch from this list, as I don't want to delete it. xargs git branch -d executes the git branch -d command on the remaining branches.

    If you want to keep multiple branches, you can extend the command:

    git branch | grep -v "main" | grep -v "develop" | xargs git branch -d

    Here, two branches, main and develop, are filtered out from the list and thus not deleted.

    I hope this tip helps you keep your system as tidy as it helps me.

  • TIL: Smaller PDFs

    Now and then I want to create PDFs and optimize the file size. I'm not necessarily in the mood to add another PDF software to my computer, and, depending on the content of the document, I don't want to complete the task online. In this situation, you can do well with Ghostscript.

    The first thing you have to do is install Ghostscript on your computer. On a Mac with Homebrew, you can accomplish this with the following command:

    brew install ghostscript

    To optimize a PDF, I use the following command.

    gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="output.pdf" input.pdf
  • Owning my podcast again

    A few weeks ago, I decided to reactivate my podcast, "Herr Zenzes wills wissen". For the last few years, I hosted it with Podigee, but it became too expensive for my use case. I don't produce enough content to take full advantage of the smallest package, so I can save some money by hosting the podcast myself again.

  • Making Estimates Work for Your Development Team

    There are topics in the IT world that divide opinions: what needs to be tested, test-driven development, do we work alone, in pairs or even in a mob? Do we need estimates for tickets?

    Today I want to discuss estimates and why I think they are essential in a dev team. I realize many developers see it differently because estimates have an awful reputation. Critics say that they don't bring much to the team, take a lot of time in meetings and at the end "management" gets a statement when which feature is (guaranteed) available. In the sprint, people are then also quick to talk about why a supposedly small task is taking a long time. So, we have something that costs us a lot of time as developers and makes life difficult afterward because someone converts story points into time. And sure, if that's how estimates are lived in team, then I would question them in that form as well. But estimates can also be useful, help the team and help to plan things.