Update Repository Script

Needed a script that would automatically pull the latest version of the repository into a folder. This script was created in an effort to automate the deployments for my blog and other websites that I manage.

The Script

#!/bin/bash 

#################################################################################
# Description: Script to automatically update the code from the repository.
# Author: Kenny Robinson, @almostengr
# Date: 2017-09-10
#################################################################################

# pull the latest code from origin
/usr/bin/git fetch --all

# make sure on the master branch
/usr/bin/git checkout master 

# pull the latest version into the current version
/usr/bin/git pull origin master
Updated: 2023-02-14 | Posted: 2017-09-10
Author: Kenny Robinson, @almostengr