xxxxxxxxxx
[alias]
a = "add ."
c = "commit -m"
pc = "!f() { git push -u origin $(git branch --show-current) ; }; f"
puc = "!f() { git pull origin $(git branch --show-current) ; }; f"
xxxxxxxxxx
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
xxxxxxxxxx
$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status
xxxxxxxxxx
# Setup short form of commands to save keystrokes
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
xxxxxxxxxx
ra = "!f() { \
git remote add $1 https://bitbucket.org/$2.git; \
}; f"
How to create a (global) git alias (shortcut).
xxxxxxxxxx
# To create an alias for a nice log output, e.g. git log --graph
$ git config --global alias.graph "log --graph"
# Then use like this:
$ git graph
# You can also add aliases to your ~/.gitconfig file
[alias]
graph = log --graph
xxxxxxxxxx
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.com commit
git config --global alias.stat status
xxxxxxxxxx
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gco='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '
alias get='git '