Giter VIP home page Giter VIP logo

git-autoeverything's Introduction

git-autoeverything

Git autocommit & autosync script

This is the start of a bigger project. For now this only support autocommit and autosync (across two directories only for now).

Usage

Don't forget to chmod +x it first.

./git-auto.sh "/first/path /second/path"

Why

Well, let's say, While i do know some alternative for syncing two directories (git-annex, rsync, etc) I preferred to make my own, because some of those didn't work the way i wanted, didn't work in all situations i wanted (rsync), or just had a steep learning curve (looking at you git-annex).

Workflow

                |Data|    
                  |
|--------|<-------|                 |--------|
| folder |                          | folder |
|        |     autosync to          |        |
|  main  |<------------------------>| second |
|--------|                          |--------|

Since the main one is already up to date after being synced to the second folder, and since the second should be empty, and thus have the same files, git will report "Still up to date" and stop.

autocommit is oneway only for now (to the main ones).

FAQ

  • What happen if you use it on a single directory?

By default, it will decide to use that + the current directory as pair...so make sure you don't do that unless you know what you're doing.

  • Can i write on both of these directories at the same time?

Yes, and No. I wouldn't recommend it for many reasons. Just choose either one as the "write" directory, and the other one as a backup/sync output...At least until i add support for multiple write handling.

  • What if i use this on git repository(ies) that isn't created by this script?

I wouldn't recommend it, because that may or may not break something in the "git flow" of those repo(s)...Can't be really sure yet but i know your commit history will look weird if anything. If you really want though, look forward for newer update of this, which may or may not support this.

  • Can this work if the pair directories have different files/similar files?

Hard to say. The way the "autosync" work isn't the way it probably sounds like. Essentially, it sync one way, but check both ways (since it doesn't know which directory is supposed to be the "write" or the "sync" one here). So I would recommend to do this only if the other directory is empty for now, and wait for more updates to support different sync methods.

TODO:

  • Support for more features
  • Support More directories for the autosync feature
  • Make use of the autocommit across multiple repos
  • Add watchman and inotify wait as alternative (given this only use git for now, which is good enough for small project)
  • More protocols support beside local repos (ssh, etc)
  • Add more comments
  • Fix GETOPT so it actually work regardless of position of the arguments...(or find a better alternative)
  • ???

Credit: https://github.com/ralfholly/git-autocommit

git-autoeverything's People

Contributors

secemp9 avatar

Watchers

 avatar

Forkers

rebron1900

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.