Last active
January 8, 2018 18:40
-
-
Save dragoljub-bogicevic-devtech/e66825ab2e12b14fa2a97eb37582d22f to your computer and use it in GitHub Desktop.
My version of .bashrc file
This file contains 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
# =============================================================== # | |
# | |
# By Dragoljub Bogicevic [dragoljub-bogicevic@devtechgroup.com] | |
# | |
# Last modified: Sun Apr 23 21:46:47 CET 2017 | |
# | |
# This file is normally read by interactive shells only. | |
# Here is the place to define your aliases, functions and | |
# other interactive features like your prompt. | |
# | |
# Licence: no lifers only!!! | |
# | |
# =============================================================== # | |
# general | |
alias c='clear' | |
alias h="cd ~/" | |
alias l='logout' | |
alias .="cd ../" | |
alias ..="cd ../../" | |
alias v="cd /d/Vagrant/" | |
alias g="cd E:\Git" | |
alias ff="find / -name " | |
alias fd="find / -type d -name " | |
# git | |
alias gi="git init" | |
alias gs="git status" | |
alias gl="git log" | |
alias glv="git log --graph --decorate --oneline" | |
alias glv2="git log --pretty=oneline --graph --decorate --all" | |
#alias glv3="git log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Creset'" | |
alias glv4="git log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Creset' --graph --all" | |
alias ga="git add" | |
# stages new and modified, without deleted | |
alias ga.="git add ." | |
# stages All | |
alias gaa="git add -A" | |
#alias gcm="git commit -m" | |
alias gcam="git commit -am" | |
alias gch="git checkout" | |
alias gchb="git checkout -b" | |
alias gst="git stash" | |
alias gsta="git stash apply" | |
alias grh="git reset --hard" | |
alias gri="git rebase -i" | |
# git flow | |
alias gfi="git flow init -d" | |
alias gffs="git flow feature start" | |
alias gffp="git flow feature publish" | |
alias gfff="git flow feature finish" | |
alias gfrs="git flow release start" | |
alias gfrf="git flow release finish" | |
# vagrant | |
alias vii="vagrant init" | |
alias vu="vagrant up" | |
alias vh="vagrant halt" | |
alias vd="vagrant destroy -f" | |
alias vssh="vagrant ssh" | |
alias vs="vagrant status" | |
alias vr="vagrant reload" | |
alias vv="vagrant -v" | |
# composer | |
alias ci="composer install" | |
alias cu="composer update" | |
alias cda="composer dump-autoload" | |
# cr function - cr symfony/console | |
# php | |
alias ps="php -S localhost:8080" | |
alias pv="php -v" | |
# phpunit | |
alias p="vendor/bin/phpunit" | |
# laravel - work in porgress | |
alias pa="php artisan" | |
alias par="php artisan routes" | |
alias pam="php artisan migrate" | |
alias pam:r="php artisan migrate:refresh" | |
alias pam:roll="php artisan migrate:rollback" | |
alias pam:rs="php artisan migrate:refresh --seed" | |
alias pda="php artisan dumpautoload" | |
# sonarqube | |
alias ss="sonar-scanner.bat" | |
# ConEmu - show shell’s working directory | |
if [[ -n "${ConEmuPID}" ]]; then | |
PROMPT_COMMAND='ConEmuC -StoreCWD' | |
fi | |
# fancy promp | |
#export PS1="\[\033[01;33m\][$USER@$HOSTNAME]\[\033[0;00m\] \[\033[01;32m\]\w\\n\[\033[01;95m\]$\[\033[0;00m\] " | |
#PROMPT_COMMAND='echo -ne "\033]0;${PWD/$HOME/~} - ${USER}@${HOSTNAME}\007"' | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\033[01;33m\][dragol]\033[01;95m\]$(__git_ps1)\[\033[0;00m\] \[\033[0;00m\]\[\033[01;32m\]\w\\n\[\033[01;95m\]$\[\033[0;00m\] " | |
#export PS1="\[\033[01;33m\][dragol]\033[01;95m\]$(parse_git_branch)\[\033[0;00m\] \[\033[0;00m\]\[\033[01;32m\]\w\\n\[\033[01;95m\]$\[\033[0;00m\] " | |
# ------- FUNCTIONS ------- # | |
# composer | |
cr() { | |
composer require $1 | |
} | |
# git | |
gcm() { | |
git commit -m \'$1\' | |
} | |
glv3() { | |
if [ -z "$1" ]; then git log --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Creset'; | |
else git log -n $1 --pretty='%Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)[%an]%Creset'; fi | |
} | |
gss() { | |
git show $1 --stat | |
} | |
gssa() { | |
git log --shortstat --author=$1 | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed: ", files, "lines inserted: ", inserted, "lines deleted: ", deleted }' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment