Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eins78/git-o-mat
A *very* simple shell script for automated git 'commit and push', which can be run from cron.
https://github.com/eins78/git-o-mat
Last synced: about 1 month ago
JSON representation
A *very* simple shell script for automated git 'commit and push', which can be run from cron.
- Host: GitHub
- URL: https://github.com/eins78/git-o-mat
- Owner: eins78
- License: other
- Created: 2012-08-01T12:04:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-06T23:37:08.000Z (about 12 years ago)
- Last Synced: 2024-04-15T03:00:41.869Z (9 months ago)
- Language: Shell
- Homepage:
- Size: 146 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/commandline/flashbake).
I use it to edit text files in my [Gitit Wiki Server](http://gitit.net) from my [Dropbox(d)](http://www.dropboxwiki.com/Using_Dropbox_CLI) folder, so I can edit the wiki without easy access to git (i.e. [Textastic](http://www.textasticapp.com) 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](http://gitit.net) 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)](http://opensource.org/licenses/MIT)