npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

one-way-git-sync

v6.0.13

Published

A tool for synchronizing a destination git repository with a source git repository SAFELY.

Downloads

186

Readme

one-way-git-sync

Test semantic-release

:arrows_counterclockwise: A tool for synchronizing a destination git repository with a source git repository SAFELY.

It provides three features:

  1. replace the files of a destination repository (dest repo) with those of a source repository (src repo),
  2. add a replacement commit (sync commit) which whose message has the history of the included commits in the src repo and
  3. detect a conflict when a dest repo has a commit which a src repo doesn't have.

How to Use

Initial Usage

Because one-way-git-sync finds a sync commit from the commit history of the dest repo, you need to run one-way-git-sync with --force option to add an initial sync commit to the dest repo by replacing all the files of the dest repo with those of src repo at first. The sample command is as follows:

yarn dlx one-way-git-sync --force \
  -d [email protected]:WillBooster/sample-of-one-way-git-sync.git

If you have no permission to write [email protected]:WillBooster/sample-of-one-way-git-sync.git, please try https://oauth2:<GitHub Personal Access Token>@github.com/WillBooster/sample-of-one-way-git-sync.git. <GitHub Personal Access Token> should be like ghp_...m4rh.

Usual Usage

If the last commit in the dest repo is a sync commit, one-way-git-sync safely synchronizes the dest repo with the src repo. So, you don't need --force option. The sample command is as follows:

yarn dlx one-way-git-sync \
  -d [email protected]:WillBooster/sample-of-one-way-git-sync.git

Deal with Conflicts

If the last commit in the dest repo isn't a sync commit, the dest repo probably has some commits (conflict commits) which don't exist in the src repo. You need to merge missing commits in the src repo into the dest repo manually at first, then, you need to run one-way-git-sync with --force option. The sample commands are as follows:

  1. yarn dlx one-way-git-sync fails, then you notice there are missing commits
  2. (for merging) git remote add upstream [email protected]:WillBooster/sample-of-one-way-git-sync.git
  3. (for merging) git merge --allow-unrelated-histories upstream/main
  4. yarn dlx one-way-git-sync --force \
      -d [email protected]:WillBooster/sample-of-one-way-git-sync.git

Example Repository and Example GitHub Actions Workflows

  • sample-of-one-way-git-sync: an example synchronized repository.
  • release.yml: releases a new npm package and add a tag automatically in this repository using semantic-release.
  • sync.yml: it synchronizes sample-of-one-way-git-sync repository using one-way-git-sync when a new version is released.
  • force-sync.yml: we can manually trigger this workflow which forces synchronizing sample-of-one-way-git-sync repository.