GithubHelp home page GithubHelp logo

it3xl / convention-over-git Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 38 KB

Example of an automated synchronization of Git remote repositories by Convention over Git.

Home Page: https://it3xl.blogspot.com/2017/09/convention-over-git.html

Shell 96.41% Awk 3.59%
git bash synchronization convention-over-git repository-synchronization shell awk

convention-over-git's Introduction

Pure Git with Convention over Git

Automated synchronization of remote Git repositories by pure Git and Convention-over-Git.


Consider to use git-repo-sync, the next generation of remote Git repositories synchronization solutions.


This approach uses well-known Git tools. It is because Git has an innate ability to do this. All we need to add is some convention.

How to use

In a terminal (console) navigate to the project's root folder and run the script

bash run.sh

Windows users have to use Git Bash that comes with any Git installation.

In sample_repos folder, you will find prepared (emulated) local and remote repositories with some commits and branches. Commit somthing or do a merge in any "local repository" and do the Git push. Then run

bash run.sh

again to see changes migrated between remote repositories.

Use in Production

Go to repo_settings folder and create there a file with your syncing repositories' settings.
Use sample_repo.sh file as an example.

Then run

bash run.sh your_file_for_repo_settings.sh

Repeat this run when you want to synchronize your remote repositories.

What is this all about!

Convention over Git is a straightforward approach for an automatic synchronization between Git remote repositories. Absolutely separate remote repositories will begin behave as a single remote repository.

This approach uses well-known Git tools. It is because Git has an innate ability to do this. All we need to add is some convention.

Also you can see code explanation in Cheat-sheet for implementation

Glossary

Glossary

Features

  • Synchronizations of git-tags was eliminated to allow GitLab block them freelly.
  • It is impossible to delete branch of another side. Such branches will be restored.
  • Auto conflict resolving by Convention over Git (non-fast-forward branch conflicts).
  • Prevention of an occasional deletion of an entire repository.
  • Failover & auto recovery of synchronization. Especially for network troubles.
  • Solution is applied per-repository (vs per-server)
  • It has been downgraded here to use two remote Git repositories for clarity, but it can work with many.
  • Bare Git repositories are used for synchronization.

Limitations

  • Do only a single commit to another repository side per the synchronization interval.

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.