You can enable short commands by updating your home .gitconfig file.
Goto /home/{user}/.gitconfig file and add contents from https://gist.github.com/gunjanpatel/10019184 file.
touch ~/.git-completion.bash
touch ~/.git-prompt.sh
Copy source from git-completion.bash file and paste it into your newly created file. Location of file:
gedit ~/.git-completion.bash
or
/home/{user}/.git-completion.bash
Update permission if required
chmod 755 ~/.git-completion.bash
Copy source from git-prompt.sh file and paste it into your newly created file. Location of file:
gedit ~/.git-prompt.sh
or
/home/{user}/.git-prompt.sh
Update permission if required
chmod 755 ~/.git-prompt.sh
Be careful while doing below steps
Find force_color_prompt in your file and remove comment #.
Before
#force_color_prompt=yes
After
force_color_prompt=yes
Copy following code in the end of the .bashrc file.
source ~/.git-completion.bash
source ~/.git-prompt.sh
MAGENTA="\[\033[0;35m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[34m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
GREEN="\[\033[0;32m\]"
GIT_PS1_SHOWDIRTYSTATE=true
export LS_OPTIONS='--color=auto'
export CLICOLOR='Yes'
export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD
export PS1=$LIGHT_GRAY"\u@\h"'$(
if [[ $(__git_ps1) =~ \*\)$ ]]
# a file has been modified but not added
then echo "'$YELLOW'"$(__git_ps1 " (%s)")
elif [[ $(__git_ps1) =~ \+\)$ ]]
# a file has been added, but not commited
then echo "'$MAGENTA'"$(__git_ps1 " (%s)")
# the state is clean, changes are commited
else echo "'$CYAN'"$(__git_ps1 " (%s)")
fi)'$BLUE" \w"$GREEN": "
alias ll='ls -lah'
alias gg='git status -s'-
Roberto Segura for Git short commands
-
How To Setup Git Completion And Repo State On Osx (Like A Pro)
Enjoy!