Skip to content

Commit

Permalink
Merge pull request tj#409 from nicolaiskogheim/refactor-alias
Browse files Browse the repository at this point in the history
Refactor alias
  • Loading branch information
hemanth committed Jul 29, 2015
2 parents 1230b99 + 83efd9a commit 5d799c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/git-alias
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

case $# in
0) git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort ;;
1) git alias | grep -e -- "$1" ;;
*) git config --global "alias.$1" "$2" ;;
1) git alias | grep -e "$1" ;;
*) git config --global alias."$1" "$2" ;;
esac
13 changes: 8 additions & 5 deletions man/git-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ git-alias(1) -- Define, search and show aliases

## SYNOPSIS

`git-alias` [<alias-name> <command>]|[<search-term>]
`git-alias`
`git-alias` <search-term>
`git-alias` <alias-name> <command>

## DESCRIPTION

List all aliases, show one alias, or set one (global) alias.

## OPTIONS

<search-term>

The pattern used for search aliases.

<alias-name>

The name of the alias to create.
Expand All @@ -18,10 +25,6 @@ git-alias(1) -- Define, search and show aliases

The command for which you are creating an alias.

<search-term>

The pattern used for search aliases.


## EXAMPLES

Expand Down

0 comments on commit 5d799c5

Please sign in to comment.