Sha256: 53f5d87c29b29f34eda35311d78cf50a24a0a7554b1914b5447391663168861a

Contents?: true

Size: 477 Bytes

Versions: 18

Compression:

Stored size: 477 Bytes

Contents

#!/bin/bash
#
# git-chop --
# 
#  Close a feature branch - removing it from local and remote.
#

die() {
  echo "$@" ; exit 1
}

head=$(git symbolic-ref HEAD 2> /dev/null || git log -1 --format=%h)
current_branch=${head#refs/heads/}

for branch in "$@" ; do
  : ${branch:-$head}
  echo "Closing feature branch $branch"

  if [ "$branch" = "$current_branch" ] ; then
    git checkout master || die
  fi

  git branch -D "$branch" || die
  git push origin ":$branch" || die
done

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
git-whistles-1.4.2 libexec/git-chop.sh
git-whistles-1.4 libexec/git-chop.sh
git-whistles-1.3 libexec/git-chop.sh
git-whistles-1.2.1 libexec/git-chop.sh
git-whistles-1.2.0 libexec/git-chop.sh
git-whistles-1.1.3 libexec/git-chop.sh
git-whistles-1.1.2 libexec/git-chop.sh
git-whistles-1.1.1 libexec/git-chop.sh
git-whistles-1.1.0 libexec/git-chop.sh
git-whistles-1.0.2 libexec/git-chop.sh
git-whistles-1.0.1 libexec/git-chop.sh
git-whistles-0.12.0 libexec/git-chop.sh
git-whistles-0.10.0 libexec/git-chop.sh
git-whistles-0.9.1 libexec/git-chop.sh
git-whistles-0.9.0 libexec/git-chop.sh
git-whistles-0.8.2 libexec/git-chop.sh
git-whistles-0.8.1 libexec/git-chop.sh
git-whistles-0.8.0 libexec/git-chop.sh