Skip to content

Instantly share code, notes, and snippets.

@numeraltwo
Created January 31, 2014 17:00
Show Gist options
  • Save numeraltwo/8736288 to your computer and use it in GitHub Desktop.
Save numeraltwo/8736288 to your computer and use it in GitHub Desktop.
useful git and git-flow aliases
# GIT / GIT FLOW ALIASES
alias gs="git stash"
alias gsa="git stash apply"
alias gsl="git stash list"
alias gsc="git stash clear"
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;
}
@sean9999
Copy link

nice

@kujiy
Copy link

kujiy commented Apr 15, 2016

Nice man!

@Moanrisy
Copy link

Feel like I am so ignorant when I found this alias created 5 years ago -,-

@LaurelineP
Copy link

👍✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment