GithubHelp home page GithubHelp logo

00mjk / forgery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from armcknight/forgery

0.0 0.0 0.0 103 KB

Automation involving GitHub/Gitlab/etc.

License: GNU General Public License v3.0

Makefile 0.37% Python 99.56% Ruby 0.07%

forgery's Introduction

forgery

Automatically clone and sync repositories from a forge such as GitHub to a macOS machine.

Getting started

  • Create an access token with repo scope from GitHub.
  • Run make init.
  • Run ./forge -h.

Commands

clone

By default, pulls a listing of all of your public, private, starred and forked repos and gists (which are backed by git repos), and associated repo wikis (which are also git repos), and clones them locally on their default branch.

Can optionally be used for an organization instead of a user account.

Each repo's directory will be tagged with the language and topics from the repo (using tag).

Forks get their origin remote renamed to fork (also set as branch.$(default).pushRemote) and get a second remote added named upstream that points to the original repo that was forked (which is set as branch.$(default).remote for default pull source).

It builds a directory structure like so:

/path/to/.../code/
├── organization
│   └── apple
│       └── repos
│           ├── forked
│           │   └── LLVM
│           │       └── LLVM
│           ├── private
│           │   └── applesPrivateCode
│           └── public
│               └── swift
└── user
    └── armcknight
        ├── repos
        │   ├── forked
        │   │   └── apple
        │   │       └── swift
        │   ├── private
        │   │   └── myPrivateCode
        │   ├── public
        │   │   ├── AdventOfCode
        │   │   ├── armcknight
        │   │   └── armcknight.wiki
        │   └── starred
        │       ├── juanfont
        │       │   └── headscale
        │       └── sindresorhus
        │           └── awesome
        └── gists (...same structure)

sync

Go through cloned repos and update them by doing things like fetching/fast-forwarding commits (and optionally for forks, pushing commits from upstream to fork), updating topic/language tags, and pruning local repos that no longer apply from remote, like unstarred repos.

TODO

  • generate a pretty report to display at the end of runs
  • collect and print errors instread of failing out of the script
  • pull with rebase to replay current local topic branch commits onto latest upstream default branch, stashing uncommitted changes
  • forks fetch/fast-forward from fork remote first, then pull with rebase from upstream, then optionally push that back up to fork (how to handle conflicts?)
  • move repos/gists between public/private directories in case those permissions are switched by the upstream owner
  • add option to create a cron job from the current invocation

forgery's People

Contributors

armcknight 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.