Skip to content

Instantly share code, notes, and snippets.

@sytrus-in-github
Last active November 3, 2016 19: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 sytrus-in-github/a2f7489be31311b852c03b9c42f79f3d to your computer and use it in GitHub Desktop.
Save sytrus-in-github/a2f7489be31311b852c03b9c42f79f3d to your computer and use it in GitHub Desktop.
A handy function for Git console to synchronize your local/remote repo. Usage: paste the function in file ~/.profile or ~/.bashrc. (or c:\Users\[your_name]\.bash_profile for Windows users)
function gsync() {
echo "*** Synchronizing current repo ***"
echo
echo "=== adding all ..."
git add .
echo
echo "=== committing all ..."
git commit -a -m "$1"
echo
echo "=== pulling ..."
git pull
echo
echo "=== pushing ..."
git push
echo
echo "*** Done! ***"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment