Quick tip: How to delete a tag from a Git repository?

The ability to tag specific changes in commit history has become very important. Programmers use git tag  to mark the releases (aka versions) of their applications. That way they can specify a desired version in their dependency tools.

Sometimes we make a mistake; we are all humans after all. We tag a wrong change set, or we tag a version on a wrong branch, or we even tag a version of other component in a current working directory. It happened to me, and I’m confident that some of those things happened to you to.

I’m sure most of you are very familiar with Git and tagging, but if you are not you should check the Git documentation page. If you are just looking for the way to delete the wrongly marked tag, then here’s the quick tip for you; so you don’t have to search through extensive documentation page.

Removing a Tag on the local repository

Deleting a tag on the local Git repository is pretty straightforward:

You can easily remember it because it’s so declarative. We can read this command as: use  git tag  command to delete -d  tag with a name 1.15 .

That will delete only the tag on your local repository. If you have already pushed your tag to the remote repository (to the Github for example), then you should also remove a tag on the remote repository.

Removing a tag on the remote repository

To delete a tag on the remote repository, we just need to push information about deleted tag to the remote:

or just:

And that’s it.

Laravel Accessors and Mutators

Laravel accessors and mutators are custom, user defined methods that allow you to format Eloquent attributes. Accessors are used to format attributes when you retrieve them from the database, while mutators format the attributes before saving them to the database.

Continue reading Laravel Accessors and Mutators

How to allow remote connections to PostgreSQL database server

After installing PostgreSQL database server, remote access mode is disabled by default for security reasons. However, sometimes you may want to allow remote connections to PostgreSQL database server from other locations, your home or office for example. In the next few lines I’ll guide you to do just that.

Connect to the remote server

First things first, you need to login to the remote server:

Continue reading How to allow remote connections to PostgreSQL database server

How To Redirect www To non-www And Vice Versa with Nginx

In this short tutorial I’ll show you how to make permanent redirect from a www URL to non-www and vice versa. I’ll assume that you have superuser privileges, sudo  or root access and Nginx already configured, as well as DNS records. More specifically, you need to have an A records for www.yourdomain.com  and yourdomain.com .

Redirect non-www to www

To redirect users from a plain, non-www domain to a www domain, you need to add this snippet in your Nginx domain configuration file:

Save your configuration and exit. Before restarting Nginx make sure to test your configuration:

Continue reading How To Redirect www To non-www And Vice Versa with Nginx

Using Repository Pattern In Laravel 5 – Eloquent Relations And Eager Loading

Preface

Before we go to the main topic of the article, I’ll give you a short heads up for some design problems you may face. Recently one of my clients complained that some pages open very slowly. When I say very, I mean incredibly slow. So I’ve decided to debug that page and what I saw shocked me. Query section was showing that on that page was executed an staggering 16500+ queries !!

Continue reading Using Repository Pattern In Laravel 5 – Eloquent Relations And Eager Loading