/git-auto

A Simple Shell Script To Do Git Commit And Push Automatically

Primary LanguageShell

git-auto

A Simple Shell Script To Commit And Push Automatically

中文文档

Usage

Download the git-auto file

chmod +x git-auto
./git-auto

More samples:

git-auto # use current script dir as git dir, and auto commit, not push.
git-auto -d /path/to/your/note's/dir   # set git dir
git-auto -p # auto commit and push
git-auto -s origin -p # set remote server
git-auto -b main -p # set git branch
git-auto -i 30 -p # set interval seconds
git-auto -o -p # execute once

For Windows Users

Before you proceed to use the git-auto file, please make sure Git installed, otherwise please download Git and install it.

  1. Just click 'yes' all the way down and you will find Git Bash icon in the start.

  2. Open PowerShell

Download the target repository if you don't have it locally yet:

git clone [your_repo_url]
cd [your_repo_location]

For those who don't yet have a repository on Github, please refer to https://docs.github.com/en/github/getting-started-with-github/create-a-repo.

  1. Usage

Download the Start-GitAutoCommit.ps1 file, and run

.\Start-GitAutoCommit.ps1

More samples:

Start-GitAutoCommit # use current script dir as git dir, and auto commit, not push.
Start-GitAutoCommit -d /path/to/your/note's/dir   # set git dir
Start-GitAutoCommit -p # auto commit and push
Start-GitAutoCommit -s origin -p # set remote server
Start-GitAutoCommit -b main -p # set git branch
Start-GitAutoCommit -i 30 -p # set interval seconds
Start-GitAutoCommit -o -p # execute once

Contributors

Thanks for your work!

PowerShell Port, by @batkiz

Readme-CN.md & Git Bash docs, by @zhanghanduo

License

Copyright © 2020 Michael Wong

Distributed under the MIT License.