Glob-aware two-way copying for git

Overview

ggcp

git-glob-copy — glob-aware two-way copying for git

Release Maintainability Test Coverage

Requirements

  • Node.js >= 16

Install

npm i git-glob-cp

# or as a global package
npm i -g ggcp

Usage

To perform various repos automations: bulk config reading, cascade template updating, etc.

CLI

# Copy `json` files from `master` branch of remote repo to local dir `temp`
git-glob-copy [email protected]:antongolub/tsc-esm-fix.git/master/*.json temp


# Push `json` files from local `.` dir to remote `json` branch
git-glob-copy *.json [email protected]:antongolub/tsc-esm-fix.git/master/json


# Push from repo to repo
ggcp '[email protected]:antongolub/tsc-esm-fix.git/master/foo/*.txt' [email protected]:antongolub/git-glob-copy.git/master/bar

ggcp is an alias for git-glob-copy

Flag Description Default
--message -m Commit message chore: sync
--version -v Print version
--help -h Show help
--ignore-files -i Path to ignoreFile (like .gitignore or .npmignore)

Pattern examples

// Absolute dir path
'/foo/bar'

// Rel paths
'./foo/bar'
'foo/bar'

// Any depth md-filter
'./**/*.md'

// git://, git@, ssh://, https:// refs
'https://github.com/antongolub/tsc-esm-fix.git/master/*.json'
'ssh://github.com/antongolub/git-glob-cp.git/test/test'
'[email protected]:antongolub/git-glob-cp.git/master/foo/bar/**/*.js'
'git://github.com/antongolub/git-glob-cp.git/some-branch-name/test/**/*.js'
// repo ref                                 // branch        // glob pattern

JS API

import { copy, sync } from 'ggcp'

const from = '[email protected]:antongolub/tsc-esm-fix.git/master/*.json'
const to = 'temp'
const msg = 'updated'
const ignoreFiles = '.gitignore'

// Copy any to any
await copy(from, to, msg, ignoreFiles)

// Synchronizes dirs only
await copydir({
  from,       // Relative dir / glob pattern(s)
  baseFrom,   // Base dir. Defaults to process.cwd()
  to,         // Rel path.
  baseTo,     // Base dir. Defaults to process.cwd()
  debug,      // Debugger. Defauts to noop
  ignoreFiles // Glob patterns to look for ignore files. string | string[]
})

License

MIT

You might also like...

Allow moving/copying/and creation embeds for blocks with drag-n-drop just like Logseq or Roam

Allow moving/copying/and creation embeds for blocks with drag-n-drop just like Logseq or Roam

Demo Features Drag-n-drop for list items in the same pane and between different panes 3 modes: move block, copy block, embed block Automatic reference

Dec 26, 2022

An example Worker for copying Cloudflare Pub/Sub messages to R2 storage

pubsub-to-r2 An example Cloudflare Worker that acts as an on-publish hook for Pub/Sub and copies a subset of messages to R2 object storage. To deploy

Jul 1, 2022

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Dec 26, 2022

A handy little app for copying & pasting images.

A handy little app for copying & pasting images.

PikPicPASTE A handy little app for copying & pasting images. Usage Click and drag the hamburger tile to move the toolbar Click the hamburger tile to s

Nov 1, 2022

Simple, lightweight, persistent two-way databinding

way.js Simple, lightweight, persistent, framework-agnostic two-way databinding Javascript library. With no to little JS code to write. And no dependen

Dec 30, 2022

Telegram Chatting is a web site-based two-way real-time chat communication application.

Telegram Chatting is a web site-based two-way real-time chat communication application.

Telegram Chatting is a web site-based two-way real-time chat communication application. Has features including two-way private messaging between users, searching user lists, viewing profiles between users, and updating user data.

Dec 27, 2022

Argon - extension for VS Code and plugin for Roblox allowing easy two-way sync of code and instances

Argon - extension for VS Code and plugin for Roblox allowing easy two-way sync of code and instances

About Argon is a simple two-way sync plugin for Roblox and extension for Visual Studio Code allowing developers not only to sync code but every possib

Dec 29, 2022

🌅 Content-aware image resizer based on Seam Carving algorithm

🌅 Content-aware image resizer based on Seam Carving algorithm

Content-aware image resizing might be applied when it comes to changing the image proportions (i.e. reducing the width while keeping the height) and when losing some parts of the image is not desirable.

Dec 30, 2022

A lightweight, locale aware formatter for strings containing unicode date tokens.

Date Token Format A lightweight (~2kB), locale aware formatter for strings containing unicode date tokens. Usage Install the package using: yarn add d

Dec 24, 2021

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

Apache MXNet (incubating) for Deep Learning Apache MXNet is a deep learning framework designed for both efficiency and flexibility. It allows you to m

Jan 5, 2023

Context-aware smart contracts for blockchain IoT systems

Context-aware smart contracts for blockchain IoT systems It contains 2 directories: contracts: contains the ContextAwareSmartContract.sol contract wit

Jun 17, 2022

An experimental framework-aware Firebase CLI

Firebase Experimental framework-aware CLI Usage $ npm i -g firebase-frameworks $ cd MY-APP $ firebase-frameworks init $ firebase-frameworks build $

Dec 27, 2022

🔥 Bon5R — Create static, blog-aware websites with pure MDX.

Bon5R Create static, blog-aware websites with pure MDX. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Projec

Jul 5, 2022

Syntactically-aware grep for JavaScript and TypeScript

ESGrep Syntactically-aware grep for JavaScript and TypeScript Usage as a CLI Install it with npm install --global esgrep or the equivalent using pnpm/

Sep 28, 2022

Content aware image cropping

Content aware image cropping

smartcrop.js Smartcrop.js implements an algorithm to find good crops for images. It can be used in the browser, in node or via a CLI. Image: https://w

Jan 4, 2023

Simple time-aware report bot for Telegram.

report bot Built using grammY. Simple time-aware report bot for Telegram. It listens for /report, /admin commands or @admin, @admins mentions in group

Oct 2, 2022

A progressively enhanced server-rendered form-aware web component counter using WebC

Eleventy WebC Number Counter Demo A progressively enhanced server-rendered form-aware web component counter using WebC. This enhances from an input t

Nov 11, 2022

Modern native Git hooks made easy 🐶 woof!

husky Modern native Git hooks made easy Husky improves your commits and more 🐶 woof! Install npm install husky -D Usage Edit package.json prepare

Jan 4, 2023

A pure JavaScript implementation of git for node and browsers!

A pure JavaScript implementation of git for node and browsers!

isomorphic-git isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read

Jan 4, 2023
Releases(v1.9.3)
Owner
Anton Golub
Principal Engineer at @qiwi / UTC+3 / Burnt out. I need a break
Anton Golub
A Two-Factor Auth Client

A Two-Factor Auth Client Tired of having to pull out your phone all the time to grab those 2fa codes? Install: npm install -g tfa Getting Help bash-3.

James M Snell 30 Dec 28, 2022
CLI Command for Two Factor Authentication.🚀

CLI Command for Two Factor Authentication.??

Yuga Sun 7 Nov 5, 2022
The easiest way of running code in a browser environment

browser-run The easiest way of running code in a browser environment. Bundles electronjs by default! Usage $ echo "console.log('Hey from ' + location)

Julian Gruber 415 Dec 19, 2022
Glob - Github action to match glob patterns and retrieve the relative file paths.

Glob - Github action to match glob patterns and retrieve the relative file paths.

tj-actions 8 Dec 12, 2022
An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

LearnGitBranching LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose

Peter Cottle 26.4k Jan 3, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
The design experiment for import.meta.glob from Vite.

vite-plugin-glob The design experiment for import.meta.glob from Vite. Motivations There are quite some scenarios that import.meta.glob wasn't conside

Anthony Fu 166 Sep 17, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Zero Two Bot,A fully Modular Whatsapp Bot to do everything possible in WhatsApp by Team Zero Two

?? ???????? ?????? ???? ?? A Moduler WhatsApp Bot designed for both PM and Groups - To take your boring WhatsApp usage into a whole different level. T

Sam Pandey 69 Dec 25, 2022