Łukasz Wieczorek's blog A slice of programmer's life

Cleaning up old remote branches in Git

This time in fish.

git fetch origin --prune
git fetch --all
for branch in (git branch --remote | egrep -v 'develop|master|\*' | tr -d ' ' | sed 's/origin\///'); git push origin ":$branch"; end

Restoring default directories

If you are using GNOME or similar desktop environment you might want sometimes delete default directories if you do not use them. Later on you figure out it would be cool to have them back, but when you create a new directory it does not have the good looking icon on it.

You can fix it with the below two commands which will regenerate the default directories.

rm ~/.config/user-dirs.dirs
xdg-user-dirs-update

Checking file encoding

Example

Tired of checking file encodings?

cd $directory
for file in *; echo "$file — "(uchardet $file); end

Packages

uchardet