Skip to content

Instantly share code, notes, and snippets.

@lewislarsen
Last active March 6, 2025 07:08
Show Gist options
  • Save lewislarsen/71e29b2986e2538700fe9a2cfbff5af7 to your computer and use it in GitHub Desktop.
Save lewislarsen/71e29b2986e2538700fe9a2cfbff5af7 to your computer and use it in GitHub Desktop.
Bash aliases
## CUSTOM ALIASES
alias main='git switch main && git pull'
alias gst='git status'
alias pull='git pull'
alias push='git push'
alias models='php artisan ide-helper:generate && php artisan ide-helper:meta && echo "no" | php artisan ide-helper:models'
alias dev='npm run dev'
alias build='npm run build'
alias mf='php artisan migrate:fresh'
alias mfs='php artisan migrate:fresh --seed'
alias art='php artisan'
alias grst='git reset --hard HEAD'
alias branch='git checkout -b'
alias conflicted='git diff --name-only --diff-filter=U'
alias abort='git merge --abort'
alias continue='git merge --continue'
alias undo='git reset --soft HEAD~1'
alias amend='git commit --amend'
alias amendno='git commit --amend --no-edit'
alias stash='git stash'
alias pop='git stash pop'
alias log='git log --oneline --graph --decorate --all'
alias tpl='php artisan test --parallel'
alias dust='./vendor/bin/duster fix'
alias pstn='./vendor/bin/phpstan analyse --memory-limit=2G'
alias rct='./vendor/bin/rector'
alias wphst='echo -n > ~/.zsh_history && echo "Zsh history has been cleared"'
alias pint='./vendor/bin/pint'
alias checkall='tpl && dust && pstn && rct'
# Custom Git Functions
commit() {
git add . && git commit -m "$*"
}
commitn() {
git add . && git commit -m "$*" --no-verify
}
# Help function to remind you of all aliases and functions
helpme() {
echo "\033[1;36m===== GIT COMMANDS =====\033[0m"
echo "\033[1;33mmain\033[0m - git switch main"
echo "\033[1;33mgst\033[0m - git status"
echo "\033[1;33mpush\033[0m - git push"
echo "\033[1;33mpull\033[0m - git pull"
echo "\033[1;33mcommit\033[0m [msg] - add all changes and commit with message"
echo "\033[1;33mcommitn\033[0m [msg] - add all changes and commit with message (no verify)"
echo "\033[1;33mgrst\033[0m - git reset --hard HEAD"
echo "\033[1;33mbranch\033[0m [name] - create and checkout a new branch"
echo "\033[1;33mconflicted\033[0m - show all files with merge conflicts"
echo "\033[1;33mabort\033[0m - abort the current merge"
echo "\033[1;33mcontinue\033[0m - continue the merge after resolving conflicts"
echo "\033[1;33mundo\033[0m - undo the last commit but keep changes"
echo "\033[1;33mamend\033[0m - amend the last commit (opens editor)"
echo "\033[1;33mamendno\033[0m - amend the last commit without changing message"
echo "\033[1;33mstash\033[0m - stash current changes"
echo "\033[1;33mpop\033[0m - apply and remove the most recent stash"
echo "\033[1;33mlog\033[0m - show pretty commit history graph"
echo "\n\033[1;36m===== LARAVEL COMMANDS =====\033[0m"
echo "\033[1;33mart\033[0m - php artisan"
echo "\033[1;33mmodels\033[0m - generate IDE helper files (auto-answers no)"
echo "\033[1;33mmf\033[0m - migrate fresh"
echo "\033[1;33mmfs\033[0m - migrate fresh with seed"
echo "\033[1;33mtpl\033[0m - run tests in parallel"
echo "\n\033[1;36m===== DEVELOPMENT COMMANDS =====\033[0m"
echo "\033[1;33mdev\033[0m - npm run dev"
echo "\033[1;33mbuild\033[0m - npm run build"
echo "\033[1;33mdust\033[0m - run duster fix (combines TLint, PHP_CodeSniffer, PHP CS Fixer, and Pint)"
echo "\033[1;33mpint\033[0m - run Laravel Pint PHP code style fixer (standalone)"
echo "\033[1;33mpstn\033[0m - run phpstan analysis with 2GB memory limit"
echo "\033[1;33mrct\033[0m - run rector"
echo "\033[1;33mcheckall\033[0m - run all tests and static analysis tools"
echo "\n\033[1;36m===== UTILITY COMMANDS =====\033[0m"
echo "\033[1;33mwphst\033[0m - wipe zsh history"
echo "\033[1;33mhelpme\033[0m - display this help menu"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment