From 8d2c660b3c7c9697aa1a7b5b7f69803ca8d55140 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Fri, 22 Aug 2014 13:33:56 -0700 Subject: [PATCH 1/3] Add some command aliases. --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index d61035c..cbb5a26 100644 --- a/README.md +++ b/README.md @@ -373,3 +373,33 @@ README.md foo.txt ``` Voila! We got our removed file back. Git reflog is also useful when rebasing goes terribly wrong. + + +## I want to add aliases for some git commands + +On OS X and Linux, your git configuration file is stored in ```~/.gitconfig```. I've added some example aliases I use as shortcuts (and some of my common typos) in the ```[aliases]``` section as shown below: + +``` +[aliases] + a = add + amend = --amend + c = commit + ca = commit --amend + ci = commit -a + d = diff + dc = diff --changed + dif = diff + ds = diff --staged + f = fetch + loll = log --graph --decorate --pretty=oneline --abbrev-commit + m = merge + one = log --pretty=oneline + outstanding = rebase -i @{u} + psuh = push + puhs = push + pul = pull + s = status + wc = whatchanged + wip = rebase -i @{u} + zap = fetch -p +``` From 9fba446438d8d924ba49acf40f57d5940c0f0c3d Mon Sep 17 00:00:00 2001 From: Joe Block Date: Fri, 22 Aug 2014 13:53:19 -0700 Subject: [PATCH 2/3] Add example - unpushed aliases to log @{u} --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cbb5a26..9ea496e 100644 --- a/README.md +++ b/README.md @@ -399,6 +399,7 @@ On OS X and Linux, your git configuration file is stored in ```~/.gitconfig```. puhs = push pul = pull s = status + unpushed = log @{u} wc = whatchanged wip = rebase -i @{u} zap = fetch -p From 0ed6dbf70604b184e6122bf878fac2fdd65d0f92 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Fri, 29 Aug 2014 14:37:42 -0700 Subject: [PATCH 3/3] Remove typo aliases, add co = checkout --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ea496e..bb39996 100644 --- a/README.md +++ b/README.md @@ -386,18 +386,15 @@ On OS X and Linux, your git configuration file is stored in ```~/.gitconfig```. c = commit ca = commit --amend ci = commit -a + co = checkout d = diff dc = diff --changed - dif = diff ds = diff --staged f = fetch loll = log --graph --decorate --pretty=oneline --abbrev-commit m = merge one = log --pretty=oneline outstanding = rebase -i @{u} - psuh = push - puhs = push - pul = pull s = status unpushed = log @{u} wc = whatchanged