Giter Site home page Giter Site logo

jayvdb / gitmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scivision/gitmc

0.0 2.0 0.0 255 KB

concurrent, pure Python asyncio + Git: manage large (100+) numbers of Git repos

Home Page: https://scivision.github.io/gitMC

License: MIT License

Shell 3.42% Python 96.58%

gitmc's Introduction

GitMC -- concurrent asynchronous Git Utilities for operations on massive numbers of Git repos

DOI Actions Status

pypi versions PyPi Download stats

Platform-independent (Linux/Mac/Windows) Git utilities, useful for managing large (100+) numbers of Git repos. Speed is an emphasis throughout, with concurrency via Python asyncio and pipelining. In general, GitMC works with all GitHub repos, including organization private repos--assuming you have created a GitHub Oauth key with appropriate permissions ("repo" needed for private org/user repos").

GitMC uses command-line Git because PyGit also requires command-line Git installed, and we don't need the advanced functionality.


Also see PyGitHub utilities for managing large (100+) numbers of users / teams.

Install

Install Git in a way accessible from the command line line

  • Mac: brew install git
  • Linux: apt install git
  • Windows: command line Git.
python -m pip install -e .

Usage

  • gitbranch Tells of any non-master branches under directory ~/code
  • gitemail list all contributor email addresses. Optionally, amend email addresses for prior Git commits

Sync large number of git repos

These assume numerous subdirectories under ~/code or c:\code. They work very quickly for large numbers (100+) repos.

  • gitmodified check if any local repos have pending changes
  • gitcheck check if any remote repos are ahead of local
  • gitpull Git pulls all repos
  • gitfetch Git fetches all repos

You can place an empty file .nogit in a subdirectory to skip it.

[optional] speedup with https pull

For public repos, to make the Git remote checking go at least twice as fast, and significantly reduce the computational burden when SSH is used for git push (as is recommended), consider the "pushInsteadOf" global Git config. To do this, when cloning a public repo (including ones you're a collaborator on), use git clone https://. This global SSH push config one-time does SSH push for HTTPS-cloned repos:

git config --global url."ssh://github.com/".pushInsteadOf https://github.com/

The pattern matching can be made for all sites by omitting github.com from the command above, or you can refine it for each site, or even for specific usernames by editing the command above. For private repos, simply clone with SSH as usual

Preview all changed Jekyll files

This is for a website made using Jekyll or Hugo:

ActOnChanged . -p

It shows web page previews of all pages changed locally--start the Jekyll or Hugo debug server first e.g. hugo serve

gitmc's People

Contributors

scivision avatar

Watchers

James Cloos 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.