Skip to content

Instantly share code, notes, and snippets.

@jconst
Created June 10, 2021 00:18
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 jconst/eeaf9e07ace86874c63b526b8f428f68 to your computer and use it in GitHub Desktop.
Save jconst/eeaf9e07ace86874c63b526b8f428f68 to your computer and use it in GitHub Desktop.
Jconst's aliases
# usage: Add this file to your home dir, then add `source ~/aliases.sh` to your .bashrc file
# git aliases:
alias g="git"
alias gs="git status"
alias gc="git commit"
alias gcm="git commit -m"
alias gl="git log --oneline --graph --decorate --all --abbrev-commit"
alias gp="git push"
alias gpl="git pull --ff-only"
alias gb="git branch"
alias gm="git merge"
alias gr="git reflog"
alias gcl="git clone"
alias gco="git checkout"
alias gd="git diff"
alias gds="git diff --staged"
alias grhh="git reset --hard HEAD"
alias gbc="git branch --show-current"
function gpsu () {
git push -u origin `gbc`
}
function ga () {
if [[ $# -eq 0 ]]; then
git add -A .
else
git add -A $@
fi
}
function gi() { curl http://www.gitignore.io/api/$@ ;}
function gfo () {
git fetch origin $1:$1
}
function fucklfs () {
git lfs uninstall
git reset --hard
git rm --cached -r .
git reset --hard
git rm .gitattributes
git reset .
git checkout .
git lfs install
git lfs pull
}
# misc other aliases:
alias ll="ls -lhA"
alias ..="cd .."
alias cd..="cd .."
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
alias myip="curl http://ipecho.net/plain; echo"
alias please='sudo $(history -p !-1)'
alias size='stat -f "%z bytes"'
alias foldersizes="find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \;"
function md () {
mkdir -p $1
cd $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment