Skip to content

Instantly share code, notes, and snippets.

@organom
Created October 20, 2020 17:29
Show Gist options
  • Save organom/663a4fd3cd5165edd38cfe30e13f17f2 to your computer and use it in GitHub Desktop.
Save organom/663a4fd3cd5165edd38cfe30e13f17f2 to your computer and use it in GitHub Desktop.
Renames a git branch
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: $0 old_branch_name new_branch_name";
else
git branch -m $1 $2
git push origin :$1 $2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment