john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Git commit and upload functions parameters

/bin/bash

2012-01 johnpfeiffer speed up commit/upload process

function addcommit() { if [ $# -ne 1 ]; then echo "Error: no parameter given to addcommit()" exit 0 else git add $1 echo "git commit $1 " git commit $1 fi }

function pullpush() { echo "Pulling any server changes first: git pull " git pull echo "Pushing change: git push " git push }

----- main ----------------------

if [ $# -ne 1 ]; then echo "Not Enough Parameters, usage is: $0 filename (or $0 directoryname) " exit 1 else TARGET=$1 if [ -f $TARGET ]; then echo "File: git add $TARGET " addcommit $TARGET pullpush else if [ -d $TARGET ]; then echo "Directory: git add $TARGET " addcommit $TARGET pullpush else echo "$TARGET not found" fi fi fi


  • « install cherokee webserver script
  • BAT wget silent install start wait »

Published

Jan 30, 2012

Category

linux

~106 words

Tags

  • and 29
  • commit 4
  • functions 7
  • git 8
  • parameters 15
  • scripts 63
  • upload 10