Skip to content

Instantly share code, notes, and snippets.

@ttscoff
Last active February 3, 2025 19:53
Show Gist options
  • Save ttscoff/ebd0a8b53534177996085830a9681611 to your computer and use it in GitHub Desktop.
Save ttscoff/ebd0a8b53534177996085830a9681611 to your computer and use it in GitHub Desktop.
remote git pull script
#!/bin/bash
# Remote host is the first argument
HOST=$1
# Remote directory is a mirror of the local directory
DIR=$(pwd)
# SSH to the host and run the pull script
ssh $HOST "~/scripts/remotepull.sh '$DIR'"
# Sync Build notes not stored in git
for file in $(ls build*.md); do
scp $file $HOST:$DIR/$(basename $file)
done
#!/bin/bash
# Simply pull the latest changes on the remote repository
# Usage: remotepull.sh <path-to-repo>
cd "$1"
git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment