‹ jan0sch.de

Tags / Git


It has been nearly two years now since I switched from Sylpheed to aerc as my daily driver for email.

While Sylpheed still is an awesome email client my switch was triggered by more heavy usage of a laptop than before and the discovery of usability problems I thought long solved like:

  • very high resolution but applications either zoomed / scaled which results in less space than needed
  • unwieldy mouse handling (touch pads suck)
  • after disabling application zooming fonts and icons were barely readable

It is nice if your CI/CD pipeline does also check for code format compliance but sometimes you may want to have feedback earlier or even prevent unformatted code to enter the repository.

In such a case the git DVCS offers hooks to the rescue. You can either dive into their documentation or simply use the script provided below. ;-)

Sometime you need or want to move a commit or several of them between different git branches. One possible scenario would involve a created feature branch which runs a bit longer and multiple important fixes have been made on it. Some might argue that this shouldn’t happen but guess what: this happens all the time. ;-)

Gitea is a nice alternative for a self hosted Git service. However there is no official support for it in the TeamCity build and continuous integration server.

Because there are way to many options for git to remember it is feasible to have a template file for the .gitconfig which is usually located in the home directory.

If you ever need to change the author of a commit (or several) within a git repository, you can use the following script:

If you want to delete a remote git branch then you can do so using the following command.

A simple shell script that jumps into a given directory (or a default one) and updates all git repos in there. Additionally it checks if an upstream remote exists. If that is the case it fetches the upstream changes.

Like the cd - command git also has a shortcut to checkout the last branch. git checkout - switches to the last checked out branch.

If you want to mirror a svn repository via git there is a nice little gem called svn2git available that provides easy setup. Updating your repository is done via svn2git --rebase.

If you’re running a non web app on the github api you can simply get the auth token for it (if you have configured in your account under applications of course) by running the following curl command.

« ältere Beiträge neuere Beiträge »