Skip to content

Instantly share code, notes, and snippets.

@dannyockilson
Last active August 1, 2019 09:56
Show Gist options
  • Save dannyockilson/2f0ad0710eb6f27e2a93475b6a76fab6 to your computer and use it in GitHub Desktop.
Save dannyockilson/2f0ad0710eb6f27e2a93475b6a76fab6 to your computer and use it in GitHub Desktop.
Dev helpers
# Docker Container management
alias docker-rm='docker rm $(docker ps -aq)'
alias docker-st='docker stop $(docker ps -aq)'
alias docker-rm-img="docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi"
# Git Helpers
function gitRmMerged() {
git branch --merged ${1:-master} | grep -v "${1:-master}" | xargs -n 1 git branch -d
}
export -f gitRmMerged
alias git-rm-merged='gitRmMerged'
function gitStarted() {
git checkout master && git pull && git checkout -b ${1:-default-branch-name}
}
export -f gitStarted
alias git-started='gitStarted'
function gitSync() {
local branch="$(git rev-parse --abbrev-ref HEAD)"
git checkout ${1:-master} && git pull && git checkout $branch && git merge ${1:-master}
}
export -f gitSync
alias git-sync='gitSync'
function gitWhere() {
local branch="$(git rev-parse --abbrev-ref HEAD)"
open -a "Google Chrome" https://waracle.atlassian.net/browse/$branch --args --profile-directory="Profile 1"
git status && git log --first-parent --no-merges -n ${1:-1}
}
alias git-where='gitWhere'
function gitPushNew() {
local branch="$(git rev-parse --abbrev-ref HEAD)"
git push -u origin $branch
}
alias git-pn='gitPushNew'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment