blob: 4d03a12e545ae8516015497a73bd85e0c7acbc7a [file] [log] [blame]
Renato Golin94cc1042016-04-26 11:02:23 +01001#!/usr/bin/env bash
2
3# This script removes a remote branch. Not that it's hard to do it, but
4# it's a very obtuse syntax from git and not straightforward. It's also
5# good to have some safety checks.
6#
7# Syntax: git-delete-remote-branch <remote> <branch>
8
9remote=$1
10branch=$2
11if [[ $remote = 'upstream' ]]; then
12 echo "Remote cannot be upstream"
13 exit 1
14fi
15if [[ $branch = 'master' ]]; then
16 echo "Branch cannot be master"
17 exit 1
18fi
19
20git push $remote :$branch