Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor alias #409

Merged
merged 2 commits into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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