Created
October 16, 2017 06:53
-
-
Save ryanmaffey/1803647171e98f12ff1df0e5639baa29 to your computer and use it in GitHub Desktop.
Some helpful Bash aliases & methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Choco | |
alias choco_ls='choco list --local-only --all-versions --include-programs'; | |
# Git | |
alias g_status='git fetch && git status'; | |
alias g_cm='git add . && git commit -m'; | |
alias g_co='git checkout .'; | |
g_sync () { | |
git add . && git commit -m '$1' && git pull && git push; | |
} | |
g_branch () { | |
git branch '$1' && git checkout '$1'; | |
} | |
g_ssh () { | |
ssh_ls=$(ls -al ~/.ssh); | |
if [ ${#ssh_ls} = 0 ]; then | |
ssh-keygen -t rsa -b 4096 -C "ryan.maffey@gmail.com"; | |
eval $(ssh-agent -s); | |
ssh-add ~/.ssh/id_rsa; | |
echo 'Copying SSH key to clipboard' | |
else | |
echo 'Copying existing SSH key to clipboard'; | |
fi | |
cat ~/.ssh/id_rsa.pub | clip; | |
} | |
# npm | |
alias npm_ls='npm list --depth=0' | |
alias npm_ls-g='npm list -g --depth=0' | |
alias npm_refresh='rimraf node_modules && npm install' | |
# Misc | |
alias ip='ipconfig'; | |
alias ip-a='ipconfig -all'; | |
alias open='start'; | |
alias delete='rimraf'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment