I need to schedule a task in Windows Server 2008 R2 to automatically push files from a folder to Github Enterprise (I don't think the "Enterprise" part will make it different than regular Github, except that ssh authentication is required).
Here's what I've done:
- Set up a public/private key pair and added them to Github and .ssh, respectively
- Created a Github repo and cloned it to a local folder
- Manually ran through the
add
,commit
, andpush
steps to make sure it works that way - Tried to write a .bat file for automatically doing step #3
- Scheduled the task to run as my user, with highest privileges, in the target folder
Unfortunately, the task fails because I am not writing the .bat file correctly.
This was my attempt at the .bat file:
echo git add . | "C:\Program Files\Git\bin\git.exe"
echo git commit -m 'scheduled commit' | "C:\Program Files\Git\bin\git.exe"
echo git push | "C:\Program Files\Git\bin\git.exe"
I found a good resource on how to do this, but it is unfortunately very Linux-specific.