Last active
October 19, 2022 07:38
-
-
Save pvroegh/633da28e615fe0e7101dc3a206b2b31a to your computer and use it in GitHub Desktop.
This script will sync a specified Git repository.
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
# This script will sync the specified Git repository. | |
# Schedule this script with the scheduler of your choosing to automate it. | |
$RepoPath = "C:\Repositories\brain2.0\" | |
cd $RepoPath | |
git pull | |
# Detect if there are any git changes. | |
$HasChanges = git status --porcelain | |
if (-Not $HasChanges) | |
{ | |
Exit | |
} | |
git pull | |
git add . | |
git commit -q -m "Last Sync: $(Get-Date -Format f)" | |
git push -q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment