Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
add a bunch of aliases by default
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Mar 30, 2010
1 parent 7e0a851 commit 28822f9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ DESTDIR =
PREFIX = $(DESTDIR)/usr/local
EXEC_DIR = $(PREFIX)/bin
PROGRAM = git-sh
SOURCES = git-sh.bash git-completion.bash \
git-sh-aliases.bash git-sh-config.bash

all: $(PROGRAM)

$(PROGRAM): git-sh.bash git-completion.bash git-sh-config.bash
cat $^ > $@
$(PROGRAM): $(SOURCES)
cat $(SOURCES) > $@
chmod 0755 $@

git-sh.1.roff: git-sh.1.ronn
Expand Down
48 changes: 48 additions & 0 deletions git-sh-aliases.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# These are the standard set of aliases enabled by default in all
# git-sh sessions. Aliases defined in the gitconfig [alias] section override
# these.

gitalias a='git add'
gitalias b='git branch'
gitalias c='git checkout'
gitalias d='git diff'
gitalias f='git fetch --prune'
gitalias k='git cherry-pick'
gitalias l='git log --pretty=oneline --abbrev-commit'
gitalias n='git commit --verbose --amend'
gitalias r='git remote'
gitalias s='git commit --dry-run --short'
gitalias t='git diff --cached'

# git add and the staging area
gitalias a='git add'
gitalias aa='git add --update' # mnemonic: "add all"
gitalias stage='git add'
gitalias ap='git add --patch'
gitalias p='git diff --cached' # mnemonic: "patch"
gitalias ps='git diff --cached --stat' # mnemonic: "patch stat"
gitalias unstage='git reset HEAD'

# commits and history
gitalias ci='git commit --verbose'
gitalias ca='git commit --verbose --all'
gitalias amend='git commit --verbose --amend'
gitalias n='git commit --verbose --amend'
gitalias k='git cherry-pick'
gitalias re='git rebase --interactive'
gitalias pop='git reset --soft HEAD^'
gitalias peek='git log -p --max-count=1'

# git fetch
gitalias f='git fetch'
gitalias pm='git pull' # mnemonic: pull merge
gitalias pr='git pull --rebase' # mnemonic: pull rebase

# git diff
gitalias d='git diff'
gitalias ds='git diff --stat' # mnemonic: "diff stat"

# git reset
gitalias hard='git reset --hard'
gitalias soft='git reset --soft'

0 comments on commit 28822f9

Please sign in to comment.