GithubHelp home page GithubHelp logo

papermill / git-o-mat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eins78/git-o-mat

0.0 3.0 0.0 86 KB

A *very* simple shell script for automated git 'commit and push', which can be run from cron.

License: Other

git-o-mat's Introduction

git-o-mat

A *very* simple shell script for automated git 'commit and push', which can be run from cron.

The basic idea is to just commit all changes files regularly no matter what, for example if you only have access via WebDAV or Dropbox. Intended use is on a (virtual) server or other always-on device which also hosts the files you want to edit, and you don't really care about commit messages.

For a more advanced implementation of automated commiting (and the inspiration to this shell script), intended to run on the device you edit the files on and trying to generate meaningful commit messages, try flashbake.

I use it to edit text files in my Gitit Wiki Server from my Dropbox(d) folder, so I can edit the wiki without easy access to git (i.e. Textastic on iPad), but there are many more uses for it.

Installation

I like to do:

git clone https://github.com/eins78/git-o-mat.git ~/.scripts/git-o-mat
sudo ln -s ~/.scripts/git-o-mat/git-o-mat.sh /usr/local/bin/git-o-mat

Then run the script from cron every minute.

crontab -e

*/1 * * * * /usr/local/bin/git-o-mat "/path/to/git/repo"

On OS X, you can edit the file is.178.git-o-mat.plist, copy it to ~/Libray/LaunchAgents/ and issue "launchctl load ~/Library/LaunchAgents/is.178.git-o-mat.plist".

It will commit only what you actually save with your text editor, so it won't be really 1 commit per minute. But the short intervall makes it more likely to catch renamed files, which happens automatically with git if the content is not also modified since the last commit.

To make it work with a GitIt Wiki]in a Dropbox folder (on a remote server) I did:

mkdir ~/Dropbox/"$WIKI"
git clone "$GITIT_PATH"/"$WIKI"/"$DOCS_FOLDER" ~/Dropbox/"$WIKI"

But since the script just does "git push" it should work with whatever default remote you defined. (So by not setting a default remote you can disable pushing per repository.

TODO

  • fail/show help on empty argument
  • accept a list and do it for all paths

License

This software is free and open source, licensed under The MIT License (MIT)

git-o-mat's People

Contributors

eins78 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.