Giter VIP home page Giter VIP logo

git-mirror's Introduction

Git mirror

Mirror a git repository periodically from one remote to another.

Usage

docker run \
  -e ORIGINAL_REPO="https://USER:[email protected]/owner/repo" \
  -e MIRROR_REPO="https://USER:[email protected]/mirrors/owner/repo.git" \
  -e CRON_STRING="*/5\t*\t*\t*\t*" \
  davidknezic/git-mirror

Configuration

ORIGINAL_REPO

This is your original repository.

It's mandatory to provide this value.

MIRROR_REPO

This is the repository you want to mirror to. Please note that all the previous commits will be irreversibly replaced by the original repository. (🚨)

It's mandatory to provide this value.

CRON_STRING

This configuration value defines how often the original repository should get mirrored into the other one.

It follows the Cron standard, in which you can set up the periodicity using 5 values, of which each one is separated by a tab character (\t).

For custom intervals please have a look at this handy Cron expression reference.

The default is every 5 minutes. (*/5 * * * *, separated with tabs \t)

Environment variables

In some cases you might be forced to provide environment variables to this container. Common scenarios are having to configure git to use a proxy or fixing the problem when pushing to a server with an invalid SSL certificate.

In both those cases you can simply provide additional environment variables to the container, like this:

docker run \
  ... \
  -e HTTP_PROXY=http://proxy:8080 \
  -e HTTPS_PROXY=http://proxy:8080 \
  davidknezic/git-mirror

or

docker run \
  ... \
  -e GIT_SSL_NO_VERIFY=true \
  davidknezic/git-mirror

However, please note that the last example is considered very insecure.

Find other possibilities in this git environment variable reference.

Contributions

Any feedback, issues and pull requests are very welcome.

License

The MIT License (MIT)

Copyright (c) 2016 David Knezić

git-mirror's People

Contributors

davidknezic avatar

Stargazers

 avatar  avatar

Watchers

 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.