Skip to content

Instantly share code, notes, and snippets.

@carlosanders
Created May 23, 2022 23:50
Show Gist options
  • Save carlosanders/37b41907608e6389993d0adacdd2317d to your computer and use it in GitHub Desktop.
Save carlosanders/37b41907608e6389993d0adacdd2317d to your computer and use it in GitHub Desktop.
alias do Cmder
e.=explorer .
gl=git log --oneline --all --graph --decorate $*
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
unalias=alias /d $1
vi=vim $*
cmderr=cd /d "%CMDER_ROOT%"
h=cat "%CMDER_ROOT%\config\clink_history"
;=h=history
;= ANDERS
;= REM p(ush) - add everything, commit everything and push
p=git add . & git commit -m "auto commit" & git push
;= REM git pull
gp=git pull
;= REM m(message) - use this instead of p(push) so can have better commit messages
m=git add . & git commit -m "$*" & git push
;= REM g(it) (l)og - view the commit log nicely
gl=git log --oneline --all --graph --decorate $*
gs=git status
;= REM nicely show a file list
ls=ls -lat --show-control-chars -F --color $*
;= REM vs code!
c=code .
;= REM parts of the filesystem I use a lot
cdd=cd /d D:
cdp=cd /d D:\projetos
cda=cd /d D:\ANDERS
# use this file to run your own startup commands for msys2 bash'
# To add a new vendor to the path, do something like:
# export PATH=${CMDER_ROOT}/vendor/whatever:${PATH}
# Uncomment this to have the ssh agent load with the first bash terminal
# . "${CMDER_ROOT}/vendor/lib/start-ssh-agent.sh"
source ~/git-flow-completion.bash
# https://stackoverflow.com/questions/4259996/how-can-i-view-a-git-log-of-just-one-users-commits
#To show the last 10 commits by Frank:
# l 10 frank
# To show the last 20 commits by anyone:
# l 20
gitlog() {
if [ "$1" ] && [ "$2" ]; then
git log --pretty=format:"%h%x09 %C(cyan)%an%x09 %Creset%ad%x09 %Cgreen%s" --date-order -n "$1" --author="$2"
elif [ "$1" ]; then
git log --pretty=format:"%h%x09 %C(cyan)%an%x09 %Creset%ad%x09 %Cgreen%s" --date-order -n "$1"
else
git log --pretty=format:"%h%x09 %C(cyan)%an%x09 %Creset%ad%x09 %Cgreen%s" --date-order
fi
}
alias l=gitlog
alias h=history
# https://githowto.com/pt-BR/history
# https://git-scm.com/book/pt-br/v2/Fundamentos-de-Git-Vendo-o-hist%C3%B3rico-de-Commits
# https://git-scm.com/docs/git-log/pt_BR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment