Splitting a Subfolder out into Its Own Repository with Git Subtree

Git Subtree

I have secretly been working on a project for a number of months now. It got a point where I decided it will be best to split some folders in the project out into their own Git repositories.…

How to Setup PHPunit Code Coverage in GitLab

Code coverage on Gitlab

In a previous post, i showed us how to set up automated testing for your PHP application. If you are using the .gitlab-ci.yml configuration i posted, chances are you will get the below notice in your build log.

No code coverage driver is available

The notice is as a result of missing Xdebug PHP extension.

To install and enable Xdebug, add the commands below to the before_script: section of your project .gitlab-ci.yml

Having done the above, go to your project settings and open the CI/CD pipelines screen.…

Getting Good with Git & GitHub


I was recently involved in building an email marketing service (think MailChimp) where we needed to automatically send alongside HTML campaigns, their plain text version.

I was assigned to get this feature built out. To accomplish this, I tested a lot of HTML to text libraries and finally, settled for this by Jevon Wright.

Using soundasleep/html2text repository, we will be learning how to fork a Git repository on GitHub, make improvement on a fork, submit pull request, fetching, pulling and merging in changes from remote.…

Signing Git Commits & Tags with GPG2 and Verified on GitHub

So i got myself a MacBook PRO and finally made the switch to Mac world after a long time being a Windows user.

One of the things i have been meaning to do was to GPG sign my git commits. Setting up my new MacBook proves to be the perfect time and finally, i did it.

The web has a number of tutorials that shows how to sign git commits with GnuPG (GPG) but none with GPG version 2.…

Dealing With “Detached HEAD” State in Git


When you pull in branches from your repository remote or upstream by running say git pull origin master (to pull changes from origin master branch) or git pull upstream non-breaking-space to pull in non-breaking-space branch from upstream; checking out any of these remote branch (e.g. git checkout upstream/non-breaking-space) will result in detached HEAD state because they aren’t proper branches as they do not (currently) exist locally.…

Git: Merge a Specific Commit From One Branch to Another


While working on one of my side projects version controlled by Git, I needed to copy and merge a commit from say BranchB to BranchA. Scenarios like this is where git cherry-pick comes in handy.

A cherry-pick is like a rebase for a single commit. It takes the patch that was introduced in a commit and tries to reapply it on the branch you’re currently on.…