Skip to content

Instantly share code, notes, and snippets.

@davidimoore
Last active June 15, 2020 21:39
Show Gist options
  • Save davidimoore/cd3d9c7094698b6ff2c2baa21f3e1e05 to your computer and use it in GitHub Desktop.
Save davidimoore/cd3d9c7094698b6ff2c2baa21f3e1e05 to your computer and use it in GitHub Desktop.
#!/bin/bash
function git_delete_local_remote_branches() {
branches=($1)
for i in "${branches[@]}"; do
git_delete_local_remote_branch $i
done
}
function git_delete_local_remote_branch() {
git push origin --delete "$1"
git branch -D "$1"
}
function git_pull_merge_master_prod() {
git checkout master
git pull origin master
git checkout production
git pull origin production
git merge master
"~/bin/lib/git_functions" 70L, 1435C
git fetch
git rebase -i origin/master
}
function git_pull_origin_master() {
git pull orign master
}
function git_log() {
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
}
function git_delete_and_push_tag() {
TAG_NAME=$1
git tag -d $TAG_NAME
git push --delete origin $TAG_NAME
git tag $TAG_NAME
git push origin $TAG_NAME
}
function rubocop_changed_files {
rubocop $(git diff --diff-filter=d --name-only `git merge-base origin/develop HEAD`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment