Skip to content

Instantly share code, notes, and snippets.

@RohanM
Last active March 12, 2025 04:57
Show Gist options
  • Save RohanM/2f960caf38c6baf614ce4e9810703135 to your computer and use it in GitHub Desktop.
Save RohanM/2f960caf38c6baf614ce4e9810703135 to your computer and use it in GitHub Desktop.
Aliases for git
alias ll='ls -l'
alias la='ls -la'
alias lls='ls -lShr'
alias llt='ls -ltr'
alias cat='bat'
alias less='bat'
alias ni='npm install'
alias rebundle='bundle && bundle clean --force && bundle pristine && echo "Rebundled!'
alias be='bundle exec'
alias r='bundle exec rails'
alias rs='bundle exec rails server'
alias rc='bundle exec rails console'
alias berc='bundle exec rubocop'
alias rspec='bundle exec rspec'
alias rspecb='git diff --name-only `git merge-base main HEAD`.. |grep "spec/" |xargs rspec'
alias kp='kubectl get pods'
alias kl='kubectl logs'
alias nd='npm run dev'
alias nt='npm run test'
alias ntw='npm run test:watch'
alias lg='lazygit'
alias zshrc='code ~/.zshrc'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gds='git diff --stat=160,160'
alias gdsm='git diff --stat=160,160 `git merge-base main HEAD`'
alias gdm='git diff `git merge-base main HEAD`'
alias gdcs='git diff --cached --stat=160,160'
alias gl='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset" -10'
alias gls='gl'
alias gll='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset"'
alias gld='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ad%Creset"'
alias gb='git branch --sort=committerdate'
alias gbmd='git branch --merged |grep -v main |xargs git branch -d'
alias ga='git add'
alias gap='git add --patch'
alias grh='git reset HEAD'
alias grs='git reset --soft HEAD^'
alias gc='git commit'
alias gcwip='git commit --no-verify -m "WIP"'
alias gco='git checkout'
alias gcom='git checkout main'
alias gcop='git checkout -'
alias gp='git push'
alias gg='git grep --color=always'
alias ggnc='git grep'
alias gri='git rebase -i'
alias grim='git rebase -i main'
alias grid='git rebase -i develop'
alias grc='git rebase --continue'
alias gra='git rebase --abort'
alias gcpc='git cherry-pick --continue'
alias gssp='git stash show -p'
alias gsh='git show HEAD'
alias gprc='git push -u && gh pr create -d'
alias gu='git up && r db:migrate && gbmd'
alias prfor='gh pr list --state merged --search'
gt() { git checkout -b `echo "$1" | sed "s/\(.*\)\/\([^\/\?]*\)[^\/]*$/\2/"` } # read trello link and create branch
alias gt='noglob gt'
f() { find . -iname "*$1*"; }
vid2gif() { ffmpeg -i "$1" -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "$2" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment