Skip to content

Instantly share code, notes, and snippets.

@jnx
Created September 13, 2016 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnx/899bee13cd357cb0fbc26582b520c743 to your computer and use it in GitHub Desktop.
Save jnx/899bee13cd357cb0fbc26582b520c743 to your computer and use it in GitHub Desktop.
git and git-flow aliases
# GIT / GIT FLOW ALIASES
alias gft="git fetch --tags"
alias gpt="git push --tags"
alias gcm="git checkout master"
alias gmm="git merge master"
alias gcd="git checkout develop"
alias gmd="git merge develop"
gcf() { git checkout feature/$1; }
gffs() { git flow feature start $1; }
gfff() { git flow feature finish -F $(git_flow_current_branch); }
gch() { git checkout hotfix/$1; }
gfhs() { git flow hotfix start $1; }
gfhf() { git fetch --tags; git pull origin master; git flow hotfix finish -F $(git_flow_current_branch); }
gcr() { git checkout release/$1; }
gfrs() { git flow release start $1; }
gfrf() { git flow release finish -F $(git_flow_current_branch); }
git_flow_current_branch(){ git rev-parse --abbrev-ref HEAD | cut -d'/' -f 2; }
glt() {
LAST_TAG=$(git for-each-ref --format="%(refname:short)" --sort=taggerdate refs/tags | tail -1 | git for-each-ref --format="%(refname:short)" --sort=taggerdate refs/tags | tail -1);
echo $LAST_TAG | xargs echo -n | pbcopy;
echo "LAST TAG: "$LAST_TAG;
}
gut (){
git tag -d $1;
git push origin :refs/tags/$1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment