Skip to main content
  • Agency for web development
  • Content Management with Primer
  • Open Source Leadership with Drupal
    Language
  • Deutsch
  • English
  • Contact
Site logo
Agentur für Webentwicklung
  • References
  • Services
  • News
  • About us
  • Agency for web development
  • Content Management with Primer
  • Open Source Leadership with Drupal
close
  1. Home
  2. Techblog Archive

Git aliases

22. August 2011
Sascha Grossenbacher Porträt
Sascha Grossenbacher

Basics

Git aliases allow to define a short, easy to remember alias for a possibly complicated git command.

The basic syntax works like this:


git config --global alias.aliasname "command"

This defines a new alias in global mode, which means that it will be available for all repositories of the currently logged in user. Below are some aliases which I like.

Better log

The following alias from http://www.jukie.net/bart/blog/pimping-out-git-log displays a nicely formatted, easily readable log output.

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

Another example to do by-character diffs:

git config --global alias.dw "diff --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'"

A different diff that is useful when moving around a lot of code, as it detects unchanged code that was only moved

git config --global alias.dm "diff --color-moved=dimmed_zebra --color-moved-ws=ignore-all-space"

Hol Dir den Newsletter

Jetzt für unseren Newsletter anmelden und monatlich wichtige Insights aus der Branche und MD Systems erhalten. 

Zur Anmeldung

About MD Systems

MD Systems, headquartered in Zurich, is a unique team of international open source initiative leaders for the Drupal content management system.

With our experts for software architecture and design and our industry solutions, you digitize your organization successfully and efficiently.

MD Systems GmbH

Hermetschloostrasse 77, CH-8048 Zürich

Schweiz

+41 44 500 45 95

[email protected]

  • Contact
  • Impressum
  • Data protection
To top

© Copyright 2023 - 2024 MD Systems GmbH. Alle Rechte vorbehalten. Erstellt mit PRIMER - powered by Drupal.