Skip to content

Instantly share code, notes, and snippets.

@maximiliano
Created April 19, 2024 13:17
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 maximiliano/29ba9d7395bf812fa3300319e6a29a7e to your computer and use it in GitHub Desktop.
Save maximiliano/29ba9d7395bf812fa3300319e6a29a7e to your computer and use it in GitHub Desktop.
Useful Aliases
# Git Aliases
## Git - Main
alias g='git'
alias gd='git diff'
alias gs='git status'
alias gb='git branch'
alias gc='git commit'
alias gco='git checkout'
alias ga='git add'
alias gl='git log'
## Git - Main with options
alias gbn='git checkout -b'
alias gadp='git add -p'
alias gds='git diff --staged'
## Git - Pull/Push/Fetch/Rebase
alias gps='git push origin'
alias gpl='git pull origin'
alias gf='git fetch'
alias gr='git rebase'
alias gpr='git pull --rebase'
alias gpro='git pull --rebase origin'
## Git - Reset and Rollback
alias grh='git reset HEAD'
alias grollback='git reset --soft HEAD~1'
# Alias for Python
## Python - Env
alias pvenv='python -m venv .venv'
alias act='. .venv/bin/activate'
## Python - Libs
alias plint='python -m black . && python -m isort .'
alias blint='python -m blue . && python -m isort .'
alias psort='python -m isort'
alias pserv='python -m http.server 8080'
## Python - Django
alias pm='python manage.py'
alias pmmg='python manage.py migrate'
alias pmmk='python manage.py makemigrations'
alias pmrs='python manage.py runserver'
alias pmsh='python manage.py shell'
alias pme='python manage.py makemessages'
alias pmc='python manage.py compilemessages'
# Alias for Javascript Yarn
alias ys='yarn start'
alias yi='yarn install'
alias yb='yarn build'
alias ya='yarn add'
alias ye='yarn extract'
alias yc='yarn compile'
# Alias for Docker
alias dim='docker images'
alias dps='docker ps'
alias dpsa='docker ps -a'
## Docker - Compose
alias dcp='docker-compose'
alias dcb='docker-compose build'
alias dcu='docker-compose up'
alias dcud='docker-compose up -d'
alias dcd='docker-compose down'
alias dcst='docker-compose stop'
alias dcps='docker-compose ps'
alias dcr='docker-compose run'
alias dce='docker-compose exec'
alias dcl='docker-compose logs'
## Docker - Remove all containers and volumes. This will delete your images and database data!
alias dcpurge='docker-compose down -v --rmi all'

Git Aliases

Git - Main

alias g='git'
alias gd='git diff'
alias gs='git status'
alias gb='git branch'
alias gc='git commit'
alias gco='git checkout'
alias ga='git add'
alias gl='git log'

Git - Main with options

alias gbn='git checkout -b'
alias gadp='git add -p'
alias gds='git diff --staged'

Git - Pull/Push/Fetch/Rebase

alias gps='git push origin'
alias gpl='git pull origin'
alias gf='git fetch'
alias gr='git rebase'
alias gpr='git pull --rebase'
alias gpro='git pull --rebase origin'

Git - Reset and Rollback

alias grh='git reset HEAD'
alias grollback='git reset --soft HEAD~1'

Alias for Python

Python - Env

alias pvenv='python -m venv .venv'
alias act='. .venv/bin/activate'

Python - Libs

alias plint='python -m black . && python -m isort .'
alias blint='python -m blue . && python -m isort .'
alias psort='python -m isort'
alias pserv='python -m http.server 8080'

Python - Django

alias pm='python manage.py'
alias pmmg='python manage.py migrate'
alias pmmk='python manage.py makemigrations'
alias pmrs='python manage.py runserver'
alias pmsh='python manage.py shell'
alias pme='python manage.py makemessages'
alias pmc='python manage.py compilemessages'

Alias for Javascript Yarn

alias ys='yarn start'
alias yi='yarn install'
alias yb='yarn build'
alias ya='yarn add'
alias ye='yarn extract'
alias yc='yarn compile'

Alias for Docker

alias dim='docker images'
alias dps='docker ps'
alias dpsa='docker ps -a'

Docker - Compose

alias dcp='docker-compose'
alias dcb='docker-compose build'
alias dcu='docker-compose up'
alias dcud='docker-compose up -d'
alias dcd='docker-compose down'
alias dcst='docker-compose stop'
alias dcps='docker-compose ps'
alias dcr='docker-compose run'
alias dce='docker-compose exec'
alias dcl='docker-compose logs'

Docker - Remove all containers and volumes.

This will delete your images and database data!

alias dcpurge='docker-compose down -v --rmi all'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment