Giter Site home page Giter Site logo

github-copy's Introduction

GitHub Copy

Repository contents

The github_copy.py tool allows copying of files from one GitHub repository to another. It also allows calling another script to perform transformations on the files before creating a pull request to send the changes to their new location.

Installation

Currently supports Linux and Windows Subsystem for Linux (WSL).

  1. Install Python 3
  2. Install your GitHub ssh key under ~/.ssh/id_rsa
  3. Set your GitHub token with export GITHUB_TOKEN=[YOUR_GITHUB_TOKEN]
  4. Run make install
  5. Add ~/.local/bin to your PATH environment variable: export PATH=~/.local/bin:$PATH

Installation without Internet

On another machine with internet:

Build a bundled version to bundle/github-copy.tar.gz using: make bundle

On target machine:

Extract the tar file and install.

tar zxvf github-copy.tar.gz
cd github-copy/dependencies
pip install * -f ./ --no-index
cd ..
make install
export PATH=~/.local/bin:$PATH

Examples

Example of copying the magefile from "g-*" to "grace-customer*":

python3 -m github-copy --source-prefix=g- --destination-prefix=grace-customer --destination-branch="master" --source-branch="master" --transformer=prefix --transformer-args="--file-prefix=magefile"

Dry-run mode allows viewing what changes would occur without actually changing the remote repositories.

python3 -m github-copy --dry-run --source-prefix=g- --destination-prefix=grace-customer --destination-branch="master" --source-branch="master" --transformer=prefix --transformer-args="--file-prefix=magefile"

The github_copy tool is also capable of running actions from the "/actions" folder in grace-actions (super cool private repository for team members) by specifying the "action" transformer and using grace-actions as the source repository.

python3 -m github-copy --dry-run --source-prefix=grace-actions --destination-prefix=g-grace --destination-branch="development" --source-branch="master" --transformer-args="--request-file ~/request.json" --action-type=ec2

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

github-copy's People

Contributors

brady-gsa avatar bryanlalexander avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

apibash

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.