Last active
June 12, 2019 23:19
-
-
Save clintonmedbery/a22dbc2fd354e3fdda2a5bd1960f7bb0 to your computer and use it in GitHub Desktop.
Useful Bash Aliases
This file contains hidden or 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
#Edit in vim | |
alias vimRc="vim ~/.zshrc" | |
alias vimHosts="sudo vim /private/etc/hosts" | |
#Edit Code | |
alias codeRc="code ~/.zshrc" | |
alias codeHosts="sudo code /private/etc/hosts" | |
#Source Terminal | |
alias sourceRc="source ~/.zshrc" | |
alias dockStopAll="docker stop $(docker ps -q)" | |
function jira () { | |
echo -e "Enter Jira Project Name:" | |
read name | |
echo -e "Enter Jira Ticket Number:" | |
read ticketid | |
URL="ceterus.atlassian.net/browse/$name-$ticketid" | |
echo "opening $URL" | |
open -a /Applications/Google\ Chrome.app https://$URL | |
} | |
function current-branch() { | |
git rev-parse --abbrev-ref HEAD | |
} | |
confirm() { | |
echo -e "Do you want to move forward? [y/n]" | |
read response | |
case "$response" in | |
[yY][eE][sS]|[yY]) | |
true | |
;; | |
*) | |
echo "Aborting" | |
;; | |
esac | |
} | |
function addCommit () { | |
branch=$(current-branch) | |
echo "Commiting to Branch Name: $branch" | |
#Assumes jira number is 3 digits long | |
start="${branch:0:7}" | |
echo "Message Prefix: $start -" | |
echo -e "What is your message?" | |
read message | |
git add . | |
echo "Git Status:" | |
git status | |
echo "Going to commit with message:" | |
fullMessage="$start - $message" | |
echo $fullMessage | |
confirm && git add . && git commit -m "$message" | |
} | |
function pushb() { | |
git push origin $(current-branch) | |
} | |
function pullb() { | |
git pull origin $(current-branch) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment