Giter Club home page Giter Club logo

git-auto-sync's Introduction

Instant automatic git-based efficient network file synchronizer

Requirements

  • git
  • inotify-tools (optional)

Use

Setup:

  • initializing new repository:

      $ mkdir -p GIT_REPO_DIR
      $ cd GIT_REPO_DIR
      $ git init
      $ git config user.name '...'
      $ git config user.email '[email protected]'
    
  • start git-daemon for your repository, for example:

      $ git daemon --export-all --base-path=$(cd GIT_REPO_DIR/..; pwd) --reuseaddr --enable=receive-pack --detach
    
  • git-auto-sync init:

      $ cd GIT_REPO_DIR
      $ git-auto-sync init myname-master git://mycollaboratorsdomain/syncbox ...
    
    • use --shallow switch to perform shallow repository cloning (if you don't need all the history)

    • WARNING: "git-auto-sync init" will reset working tree to state of a remote peer's branch

Automatic synchronization:

$ cd GIT_REPO_DIR; git-auto-sync run

Created, changed and deleted files will be replicated to other peers automatically. In the case of conflict which can happen when two peers change the same file at roughly the same time, both file versions are preserved by automatic renaming (file -> file.branch1 and file.branch2).

  • use "git-auto-sync run --periodic" to force periodic synchronization together with instant on-change sync

If you don't have inotify-tools installed:

$ cd GIT_REPO_DIR; git-auto-sync run_with_polling 60 # secs

Manual synchronization:

$ cd GIT_REPO_DIR; git-auto-sync once

Tests

$ cd tests; ./t2 test1 && ./t2 test2

Todo

  • better handling of failures

  • when using inotify-tools for automatic detection of changes, support full directory hierarchy synchronization instead of top directory only

Related

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.