Last active
November 12, 2016 13:26
-
-
Save drasive/7b49773ec414cdf4c4dbdf1a773e6fe0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get parameters | |
git_repository_path=$1 # Path to the Git repository that is used for the backup (local) | |
git_remote_path=$2 # Path of the Git remote that is used for the backup (external) | |
# Add files to Git index and create commit | |
(cd $git_repository_path && | |
git add . && | |
git commit -m "Automated commit by git-backup" --quiet 1> /dev/null) | |
# Push to Git remote | |
(cd $git_repository_path && | |
git push --repo $git_remote_path --quiet 1> /dev/null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment