Skip to content

Instantly share code, notes, and snippets.

@anshulsahni
Last active January 3, 2023 10:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anshulsahni/b36973cbe56e1891fa273ff082737f3b to your computer and use it in GitHub Desktop.
Save anshulsahni/b36973cbe56e1891fa273ff082737f3b to your computer and use it in GitHub Desktop.
List of different kinds of aliases I use
### deployment tool aliases
## docker
# docker image
alias dckils='docker image ls'
alias dckilsa='docker image ls -a'
# docker container
alias dckcls='docker container ls'
alias dckclsa='docker container ls -a'
# docker container
dckbld () { docker build --tag="$1":latest .; }
## git
# git push
alias gpo='git push origin'
alias gpof='git push origin'$1' --force-with-lease'
# git pull
alias guo='git pull origin'
alias guor='git pull -r origin'
# git reset
alias grh='git reset HEAD'
alias grh1='git reset HEAD~1'
# git add
alias gap='git add -p'
alias gafp='git add '$1' -p'
alias gaa='git add --all'
alias gad='git add'
# git commit
alias gco='git commit'
alias gcon='git commit --amend --no-edit'
alias gcoa='git commit --amend'
alias gcov='git commit -n'
# git log
alias glo='git log'
alias gloo='git log --oneline'
# git checkout
alias gho='git checkout'
alias ghob='git checkout -b'
# others
alias gis='git status'
alias after_guo='git diff --color-words master@{1}..master'
## github cli
alias clone='gh repo clone'
alias create_pr='gh pr create'
alias create_isu='gh issue create'
alias create_gis='gh gist create'
alias create_repo='gh repo create'
alias my_open_prs='gh pr list --author=@me'
alias hrl='gh run list'
alias hrf='gh run list -w'
### Aliases which doesn't fit anywhere else
# ls
alias lsag='ls -la | grep'
alias lsa='ls -la'
# qpdf
pdf_combine () { qpdf --empty --pages "$1" 1-z "$2" 1-z -- "$3"; }
pdf_decrypt () { qpdf --decrypt -password=$@; }
#dpkg
alias deb_add='sudo dpkg -i'
#apt
alias apt_add='sudo apt install'
#Helmfile
alias hsync='helmfile -f ~/Works/razorpay/kube-manifests/helmfile/helmfile.yaml sync'
alias hdel='helmfile -f ~/Works/razorpay/kube-manifests/helmfile/helmfile.yaml delete'
alias hopen='code ~/Works/razorpay/kube-manifests/helmfile/helmfile.yaml'
### package managers
## NPM
# npm install
alias npi
alias npes='npm install --save--exact'
alias npis='npm install --save'
alias nped='npm install --save--exact --save-dev'
alias npid='npm install --save-dev'
alias npig='npm install --global'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment