Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.
/ git-autosave Public archive

Perform auto-saving git repositories that correspond to some criteria

License

Notifications You must be signed in to change notification settings

Leomaradan/git-autosave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Auto-Save

Perform auto-saving git repositories that correspond to some criteria

NPM version

Installation

With npm:

npm install -g git-autosave

With yarn 1.x:

yarn global add git-autosave

With yarn 2+ (installing and executing):

yarn dlx git-autosave

How to use

By default, the script will search for each git repository in the current folder, and in all subfolder, excluding node_modules folder

In each folder, it will search for the package.json file, and check if a .git folder exists. If that criteria match, the script will check if the current branch has a keyword in its name (default keyword: draft)

If all that critera match and there is some file to commit, it will add the files, commit with the date as a message, and push to origin.

The script doesn't check the last commit date. Executing the command multiple time can result of a lot of commits. Use this command in a schedule task

Options

Some options can be configured:

  • Base directory. The base directory can be set with --dir=<my working dir>
  • Search Term. The default search term is package.json. It can be override with --search=<my entry point>
  • Branch Term. The default branch term is draft. It can be override with --branch=<my branch name>
  • Searching through node_modules. By default, the script omit node_modules folder. It can be override with -i

Runing the script

With default options

git-autosave

Other examples

git-autosave --dir=".." -i

Other examples

git-autosave --dir="D:/Code/auto-save" --search=Gemfile --branch=temp

About

Perform auto-saving git repositories that correspond to some criteria

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published