Skip to content

Instantly share code, notes, and snippets.

@pktharindu
Last active September 22, 2023 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pktharindu/08ba98ebed7faf8221b738eab5539322 to your computer and use it in GitHub Desktop.
Save pktharindu/08ba98ebed7faf8221b738eab5539322 to your computer and use it in GitHub Desktop.
Adding Bash Aliases
# Git
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias nah="git reset --hard && git clean -df"
alias gs="git status"
alias gp="git pull"
alias sw="git switch"
# Laravel
alias art="php artisan"
alias mr="php artisan migrate:refresh"
alias mrs="php artisan migrate:refresh --seed"
alias mf="php artisan migrate:fresh"
alias mfs="php artisan migrate:fresh --seed"
alias tinker="php artisan tinker"
alias test="php artisan test --without-tty --parallel -p10"
alias testc="php artisan test --coverage-html storage/logs/coverage"
alias behat="./vendor/bin/behat"
alias phpstan="./vendor/bin/phpstan analyse"
alias anl="./vendor/bin/phpstan analyse"
alias abb="php artisan blueprint:build"
alias abe="php artisan blueprint:erase"
alias cc="php artisan optimize:clear"
alias routes="php artisan route:list --except-path=telescope,horizon,_debugbar,_ignition"
# Composer
alias cr="composer require"
alias cu="composer update"
alias ci="composer install"
alias cdo="composer dump-autoload"
# Docker
alias dd="docker-compose down"
alias du="docker-compose up -d nginx mysql phpmyadmin redis workspace"
# ElasticSearch
alias es="elasticsearch"
# NPM
alias ni="npm install"
alias nrd="npm run dev"
alias nrw="npm run watch"
alias nrt="npm run test"
alias nlf="npm run lint --fix"
# Yarn
alias yu="yarn upgrade"
alias yd="yarn dev"
alias yd="yarn watch"
alias yd="yarn test"
alias ylf="yarn lint --fix"
# CS Fixer
alias csf="php-cs-fixer fix"
alias test2="php artisan test --without-tty --parallel --env=testing -p2"
alias queue="php artisan queue:listen --tries=1 --queue=medium,high,low,files,files-au,files-ie,files-us,files-ca,assignments,webhooks --timeout=9000"
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Adding Bash Aliases

Add .bashrc and .bash_aliases files with below content into:

C:\Users\<Username>\

To add the same into Docker workspace:

  • Bash into workspace
  • Run vi ~/.bash_aliases
  • Hit insert button to start editing
  • Copy and paste the content in .bash_aliases
  • Hit esc and :x to save and exit the editor
  • Source this file by running source ~/.bash_aliases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment