Skip to content

Instantly share code, notes, and snippets.

@KornelDylski
Last active May 11, 2022 09:35
Show Gist options
  • Save KornelDylski/6830a03b2e1c41b957567671b9fc66c1 to your computer and use it in GitHub Desktop.
Save KornelDylski/6830a03b2e1c41b957567671b9fc66c1 to your computer and use it in GitHub Desktop.
# winpty fix
alias python='winpty python.exe'
alias pip='winpty pip'
# custom aliases
alias rt='reset'
alias ll='ls -la'
alias l='ls -1'
alias la='ls -a'
# git aliases
alias g=git
alias gs='git status'
alias ga='git add'
alias gaa='git add --all'
alias gstage='git add *' # stage all
alias gunstage='git reset' # unstage all
alias greject='git checkout .' # reject unstaged
alias gb='git branch' # list
alias gba='git branch -a' # list all
alias gbnm='git branch --no-merged' # list not merged
alias gbr='git branch --remote' # list remote
alias gbn='git checkout -b' # new branch
alias gbrm='git branch --no-color --merged | grep -vE "^([+*]|\s*(master|develop)\s*$)" | xargs git branch -d 2>/dev/null' # remove merged branches
alias gbl='git blame -b -w' # blame
alias gco='git commit -v' # commit
alias gcoa='git commit -v -a' # commit all
alias gcom='git commit -v -m' # commit with message
alias gam='git commit -v --no-edit --amend' # amend
alias gama='git commit -v -a --no-edit --amend' # amend all
alias gc='git checkout' # checkout
alias gcd='git checkout develop'
alias gcm='git checkout master'
alias gcrc='git checkout `git branch --all | grep [^/]release/RC* | sed "s/* //"`' # checkout RC branch
alias gd='git diff'
alias gf='git fetch' # fetch
alias gfa='git fetch --all' # fetch all branches
alias gfc='git fetch --prune-tags' # prune all merged tags
alias gfd='git fetch origin develop:develop' # fetch develop
alias gfm='git fetch origin master:master' # fetch master
alias gl='git pull'
alias glr='git pull --rebase'
alias gup='git branch --no-color --no-merged | grep -oP "[^*\s]\S*" | xargs -I{} git fetch origin {}:{}' # pull all not merged branches
alias gp='git push'
alias gpv='git push -v'
alias gpf='git push --force-with-lease' # push force
alias 'gpf!'='git push --force'
alias gps='git push --set-upstream origin `git rev-parse --abbrev-ref HEAD`'
alias grb='git rebase'
alias grbm='git rebase master'
alias grbd='git rebase develop'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias gma='git merge --abort'
alias grh='git reset --hard'
alias gclean='gfc; gbrm;' # fetch all, remove unused and merged branches
alias glog='git log --all --pretty=format:"%an, %ar: %s"'
alias gmy='glog | grep "Kornel Dylski" | grep -v "Merge" | grep -v "update changelog" | head -n 20 | sed "s/^[^,]*,//" | sed "s/:/:\t/1"'
# npm aliases
alias ni='npm install'
alias nci='npm ci'
alias nr='npm run'
alias nrd='npm run dev'
alias nrs='npm run start'
alias nrb='npm run build'
alias nrl='npm run lint'
alias nrlf='npm run lint-fix'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment