Skip to content

Instantly share code, notes, and snippets.

@miketierney
Last active December 13, 2015 20:18
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 miketierney/4968487 to your computer and use it in GitHub Desktop.
Save miketierney/4968487 to your computer and use it in GitHub Desktop.
Useful little script to sync your current tracking branch with it's remote counter-part. Save to ~/bin as "git-sync" and then `chmod +x` to get it to work.
#!/bin/bash
#
# $ git sync
# Pulling from remote...
# Current branch master is up to date.
#
# Pushing to remote...
# Everything up-to-date
#
git_sync() {
echo "Pulling from remote..."
git pull
echo -e "\nPushing to remote..."
git push
}
git_sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment