From 7d8adcb4075677045f664d814840b0aaae81bb47 Mon Sep 17 00:00:00 2001 From: Diogo Lemos Date: Wed, 22 Feb 2017 17:26:38 +0000 Subject: [PATCH] Add list all git aliases --- README.md | 12 ++++++++++++ tips.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index d965a0e..47dc259 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`. * [Generates a summary of pending changes](#generates-a-summary-of-pending-changes) * [List references in a remote repository](#list-references-in-a-remote-repository) * [Backup untracked files.](#backup-untracked-files) +* [List all git aliases](#list-all-git-aliases) @@ -1087,5 +1088,16 @@ git ls-remote git://git.kernel.org/pub/scm/git/git.git git ls-files --others -i --exclude-standard | xargs zip untracked.zip ``` +## List all git aliases +```sh +git config -l | grep alias | sed 's/^alias\.//g' +``` + + +__Alternatives:__ +```sh +git config -l | grep alias | cut -d '.' -f 2 +``` + diff --git a/tips.json b/tips.json index 9fe00f9..d0ac2fe 100644 --- a/tips.json +++ b/tips.json @@ -466,4 +466,8 @@ }, { "title": "Backup untracked files.", "tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip" +}, { + "title": "List all git aliases", + "tip": "git config -l | grep alias | sed 's/^alias\\.//g'", + "alternatives": ["git config -l | grep alias | cut -d '.' -f 2"] }]