Skip to content

A simple batch script that executes every X seconds and automatically pushes the contents of the specified directory to your GitHub repository.

Notifications You must be signed in to change notification settings

Rich2020/GitHub-auto-push-for-Windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

GitHub-auto-push-for-Windows

When writing documents (such as your thesis or a paper), it's a nice idea to have different versions of that document. With versioning, you can look up past versions and copy out whatever has been lost in newer versions.

No matter what files you want to back up and version, just pop them into a folder somewhere and let this script automatically push them to GitHub.

Let's say you have a file called Thesis.docx (a Word document) and a folder on your desktop called Writings.

  • Place your Thesis.docx file into your Writings folder (and anything else you want uploaded to GitHub).

  • Next, go to GitHub and create your repository (lets call it Writings, too) and clone your new repository to your desktop (To the Writings folder).

  • Make sure that your GitHub repository is set to SSH:

SSH settings

GitHub requires a username and password and this can be really annoying if you have to type it in every time you push. You can cache your username and password by running the following from your command prompt:

$ git config credential.helper store
$ git push https://github.com/<USERNAME>/<REPOSITORY>.git
Username for 'https://github.com': <USERNAME>
Password for 'https://USERNAME@github.com': <PASSWORD>

Where <REPOSITORY> is the name your your repo (Writings in this example), and <USERNAME> and <PASSWORD> are well... your username and password for GitHub. Source: http://stackoverflow.com/questions/8588768/git-push-username-password-how-to-avoid

  • Open the GitAutoPush.batch file and edit cd <path> by replacing <path> with the path to your directory (Writings). Eg: C:\Users\Rich\Desktop\Writings

  • Now that you are all set up, run the GitAutoPush.batch file.

It will by default, push every 300 seconds (5 minutes). It will pull any changes made to your repository, too. It will push any files in your Writings directory, so make sure that you know what is being pushed.

Change as required.

About

A simple batch script that executes every X seconds and automatically pushes the contents of the specified directory to your GitHub repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published