Direkt zum Inhalt
  • Agentur für web development
  • Content Management mit Primer
  • Open Source Leadership mit Drupal
    Sprache
  • Deutsch
  • English
  • Kontakt
Logo der Website
Agentur für Webentwicklung
  • Referenzen
  • Angebot
  • Aktuelles
  • Über uns
  • Agentur für web development
  • Content Management mit Primer
  • Open Source Leadership mit Drupal
close
×

Info message

This content has not been translated to Deutsch yet. You are reading the English version.

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

Über MD Systems

MD Systems mit Firmensitz Zürich ist ein einzigartiges Team von internationalen Open Source Initiative Leadern für das Content Management System Drupal.

Wir begleiten Sie von der Idee und Konzeption über die Realisation bis hin zur Einführung, Betrieb und laufenden Optimierung.

MD Systems GmbH

Hermetschloostrasse 77, CH-8048 Zürich

Schweiz

+41 44 500 45 95

[email protected]

  • Kontakt
  • Impressum
  • Datenschutz
To top

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