Skip to content

Instantly share code, notes, and snippets.

@mariolopjr
Created January 22, 2014 00:14
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 mariolopjr/8551160 to your computer and use it in GitHub Desktop.
Save mariolopjr/8551160 to your computer and use it in GitHub Desktop.
Automates pushing the Octopress source, just do "push Commit message" and the script will do the rest!
#!/bin/bash
#
# push.sh
#
# Mario Lopez (http://techsym.com) @cubanresourceful
# Use and modify freely, attribution appreciated
#
# Generates and deploys an Octopress instance for you.
#
# Usage
# $ push Message of commit
#
# NOTE: Do not wrap the parameters in quotes
#
#
# Variables
#
# Name of the branch that will receive the source code
StrBranchName="source"
# Location to your Octopress source
StrOctopressSource="$HOME/Documents/Projects/techsym.com/octopress/source"
# Name of the Git Remote Server
StrRemoteName="origin"
#
# Script Execution
#
# Change to the directory that houses your Octopress source
cd $StrOctopressSource
# Sets the commit message based upon the input args
StrCommitMessage="$@"
# Executes git commands
git add .
git commit -m "$StrCommitMessage"
git push $StrRemoteName $StrBranchName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment