Last active
March 12, 2019 15:42
-
-
Save hectorcanto/cc9022f0a0ab28b7e30f01f07e06a4f6 to your computer and use it in GitHub Desktop.
[Configure git aliases] A script to configure several git aliase #git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[00;33m\]\$(git_branch)\[\033[00m\]\$ " | |
alias g='git' | |
source /usr/share/bash-completion/completions/git | |
complete -o default -o nospace -F _git g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global user.name $NAME | |
git config --global user.email $EMAIL | |
git config --global alias.s status 321 git config --global alias.s status | |
git config --global alias.a add | |
git config --global alias.d diff | |
git config --global alias.dh "diff HEAD" | |
git config --global alias.pl pull | |
git config --global alias.p push | |
git config --global alias.l "log --pretty=format:'%C(yellow)%h %Cred%<(12,trunc)%ad %Cblue%<(8,trunc)%an%Cgreen%d %Creset%s' --relative-date" | |
git config --global alias.co checkout | |
git config --global alias.b branch | |
git config --global alias.t tag | |
git config --global color.ui true | |
git config --global color."diff".meta "yellow bold | |
git config --global color."diff".frag "magenta" | |
git config --global color."diff".old "red" | |
chmod +x /usr/share/doc/git/contrib/diff-highlight/diff-highlight | |
git config --global pager.diff "/usr/share/doc/git/contrib/diff-highlight/diff-highlight | less" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment