Last active
August 29, 2015 14:04
-
-
Save saltlakeryan/d798a7b29023e0880f50 to your computer and use it in GitHub Desktop.
git 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
#!/bin/bash | |
flowcycle() { | |
EDITOR=vim | |
TAG=$(git tag | tail -1) | |
NEXTTAG="${TAG%.*}.$((${TAG##*.}+1))" | |
REL=$NEXTTAG | |
DIR="$( pwd )" | |
DOCKER_REPO="docker.nanofab.utah.edu:5000" | |
DOCKER_IMAGE="$(echo $DIR | perl -pe 's!.*/docker\-!!')" | |
GREP="grep '$DOCKER_REPO/$DOCKER_IMAGE\s*latest'" | |
DOCKER_IMAGE_HASH="$(docker images | grep $DOCKER_REPO/$DOCKER_IMAGE | grep latest | awk '{print $3}')" | |
DOCKERTAG="docker tag $DOCKER_IMAGE_HASH $DOCKER_REPO/$DOCKER_IMAGE:$NEXTTAG; docker push $DOCKER_REPO/$DOCKER_IMAGE:$NEXTTAG" | |
CMD="EDITOR=vim; git flow release start $REL; git flow release finish $REL; git push; git push -u origin $REL" | |
echo "Run this?" | |
echo " $CMD" | |
echo " $DOCKERTAG" | |
read RESPONSE | |
if [ $RESPONSE = "Y" ] || [ $RESPONSE = "y" ] | |
then | |
echo "OKAY" | |
/bin/bash -c '$CMD' | |
else | |
echo "NEVERMIND" | |
fi | |
} | |
alias ga='git add' | |
alias gp='git push' | |
alias gl='git pull' | |
alias gll='git log' | |
alias gst='git status' | |
alias gd='git diff' | |
alias gc='git commit' | |
alias gcm='git commit -m' | |
alias gca='git commit -a' | |
alias gcam='git commit -am' | |
alias gb='git branch' | |
alias gco='git checkout' | |
alias gra='git remote add' | |
alias grr='git remote rm' | |
alias gcl='git clone' | |
alias grm='git rm' | |
alias g='git' | |
alias gfi='git flow init' | |
alias gffs='git flow feature start' | |
alias gfff='git flow feature finish' | |
alias gfrs='git flow release start' | |
alias gfrf='git flow release finish' | |
alias gfc='flowcycle' | |
alias gt='git tag' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment