My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Tag: Git

  • Git: Querying Tags Without Cloning the Repository

    PROBLEM A typical way to get a list of tags from a repository is to clone it before running git tag:- versionsort.suffix=- ensures 1.0.0-XXXXXX comes after 1.0.0. To retrieve the latest tag:- While it works, it requires us to clone the repository first, and if we want to retrieve tags from multiple repositories, we are […]

  • Git: Configuring Different Git User Info Depending on Projects

    PROBLEM Given, the following global config stored under ~/.gitconfig… When committing any code, the above user info will always be used. However, there are times you want to use a different user info depending on projects (ex: work projects, GitHub projects, etc) SOLUTION This is one of many ways to solve this problem. Let’s assume […]

  • Git + Linux: (gnome-ssh-askpass:24871): Gtk-WARNING **: cannot open display:

    PROBLEM When running git clone on Linux, the following error appears:- SOLUTION To fix this, run the following command to disable gnome-ssh-askpass:- Now, git clone will work just fine:- To prevent this from happening again, add unset SSH_ASKPASS command to .bashrc file.