The first one is super simple – we want to remove all the references that are no longer on the remote. This can be done by executing our first clean up command:
git fetch --prune
Then we can remove any of the old branches that have already been merged. For that we can use the below command:
git --no-pager branch --merged | grep -Ev 'master|^\*' | xargs git branch -d
The first command gets a listing all the branches that have already been merged:
git --no-pager branch --merged
Next we need to remove the branches we want to keep. This is being done with a reverse regex
(anything separated by the
is a or). The first one is the master branch we obviously don’t want to remove that. The next one is the branch starting with a
or in our case this is the branch you are currently on. Feel free to add any other branch names in here; for instance
if you’re using the git flow workflow:
grep -Ev 'master|^\*'
Lastly we want to delete all the branches that are being printed out. This bit is simple – we can just use the
git branch -d
command and run it with
so we can pipe to the command. You may want to leave this last bit off on the first run so you can see what branches will be deleted as there is no
flag for this delete command:
xargs git branch -d
DIVI for Wordpress. Load Alt tags in Divi directly from the Media Library, pull alt tags in automatically even when these are added or changed from the Wordpress Media Library.
So here it is – 2021. A year of lockdowns, mockdowns and a really big one in terms of workload, projects and dare we say success.
It is our designer Anna’s last week here at Practically, and she was made to do a show and tell of her time with us. We thought it was rather cool that, firstly, she created it as a web page, and secondly the way she represented her time here. Enjoy!