Skip to content

Instantly share code, notes, and snippets.

@guillaumebadin
Last active May 5, 2020 10:31
Show Gist options
  • Select an option

  • Save guillaumebadin/c189eadf183a4008cf2d5770599645f4 to your computer and use it in GitHub Desktop.

Select an option

Save guillaumebadin/c189eadf183a4008cf2d5770599645f4 to your computer and use it in GitHub Desktop.
sk_synchro() {
CURRENT_BRANCH=`git branch | sed -n '/\* /s///p'`
git checkout master
git pull
git checkout develop
git pull
git checkout $CURRENT_BRANCH
}
sk_flow_init(){
git fetch --all
git flow init -d
}
sk_pull() {
git fetch --all
git pull --all
git pull --tags
}
sk_push() {
git push --all
git push --tags
}
sk_feat_start() {
sk_synchro
name=$1
git flow feature start $name
git flow publish
}
sk_feat_finish() {
sk_synchro
git flow feature finish
sk_push
}
sk_bugfix_start() {
sk_synchro
name=$1
git flow bugfix start $name
git flow publish
}
sk_bugfix_finish() {
sk_synchro
git flow bugfix finish
sk_push
}
sk_hotfix_start() {
sk_synchro
name=$1
git flow hotfix start $name
git flow publish
}
sk_hotfix_finish() {
sk_synchro
git flow hotfix finish
sk_push
}
## Admin only
sk_release_start() {
sk_synchro
name=$1
git flow release start $name
git flow publish
}
sk_release_finish() {
sk_synchro
git flow release finish
sk_push
}
sk_clean_branch() {
echo "😨 Êtes vous sur ? les branches non pushés sur le remote seront effacés 😨"
echo "tapez oui ou non"
read x
if [ "$x" = "oui" ]
then
git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
# do the dangerous stuff
fi
}
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version"
j8
alias j7="export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; java -version"
alias proj='cd ~/Documents/pro/projects/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment