Skip to content

Instantly share code, notes, and snippets.

@roderik
Created June 21, 2010 12:49
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 roderik/446802 to your computer and use it in GitHub Desktop.
Save roderik/446802 to your computer and use it in GitHub Desktop.
#!/bin/bash
COL_NORM="$(tput sgr0)"
COL_RED="$(tput setaf 1)$(tput bold)"
COL_GREEN="$(tput setaf 2)$(tput bold)"
if [ -z "$1" ]
then
echo "${COL_RED}No branch defined${COL_NORM}"
echo "Usage: git publish [branch]"
exit 1
else
echo "Publishing branch ${COL_GREEN}$1${COL_NORM} to the server"
git push origin $1
git config branch.$1.merge refs/heads/$1
git config branch.$1.remote origin
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment