Useful Git Aliases

If you’re a software developer, you most likely use git. Many people are not aware that you can create an alias for commands. Creating alias will make commands easier to remember and quicker to type. Here are some of my favorite git alias I use on a regular basis.

Short for git status

alias gs="git status"

Quickly commit with wip message

alias wip='git add . && git commit -m "wip"'

Updates your branch and submodules

alias gpa = "!git pull --rebase --prune $@ && git submodule update --init --recursive"

Reset all changes (use with caution)

alias nah="git reset --hard && git clean -df"

 

Leave a comment below on your favorite alias commands.

Alternatives to Google Url Shortener

About a year ago, Google announced they would be shutting down their URL shortener service March 30, 2019. Goo.gl has been around since 2009. This is unfortunate because so many people rely on goo.gl for creating short links. Bit.ly is a good choice if you need to shorten a few URLs, but once you go over the free plan (10,000 a month), you have to upgrade to their enterprise edition, which cost around $1,000 a month.

Fortunately, there are a few free options such as t.ly, tinyurl, is.gd, to.ly, and cutt.ly. Also, there are extensions such as Link Shortener, that allow you to shorten links in one click using multiple different shorteners. If you have a need to shorten URLs, give  Link Shortener a try!

Firefox Allow Self Signed Certificate

Firefox is no longer accepting my self signed SSL certificate on .dev domains, which I use for local development. I started seeing this error message: MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT. To get around this error, you usually can tell the browser add an exception to allow the certificate. But it appears the latest version of Firefox is not allowing the user to trust the certificate. 

Here are the steps to allow a self-signed certificate.

  1. Browse to about:config
  2. Search for “network.stricttransportsecurity.preloadlist”.
  3. Set it to false.

Now you should be able to add an exception for the self-signed certificate to Firefox.

Disclaimer: Disable the preloadlist could lead to security risk. I would recommend moving away from .dev when possible.

How to Stop Developer Tools Prompting For Password

After updating to macOS Mojave, I started getting a prompt for a user name and password everytime I debugged golang in GoLand. This was frustrating but I was able to stop it from prompting by running this command in my terminal:

sudo /usr/sbin/DevToolsSecurity --enable

Once I ran this command, I stopped seeing the prompt for “Developer tools access needs to take control of another process for debugging to continue. Type your password to allow this.”

Hopefully, this works for you!