All Projects → b1f6c1c4 → Hub Sync

b1f6c1c4 / Hub Sync

Licence: mit
Sync your github forks without git.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hub Sync

Figma Graphql
The reimagined Figma API (super)powered by GraphQL
Stars: ✭ 354 (+1585.71%)
Mutual labels:  api, tools
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (+214.29%)
Mutual labels:  api, sync
Hoppscotch
👽 Open source API development ecosystem https://hoppscotch.io
Stars: ✭ 34,569 (+164514.29%)
Mutual labels:  api, tools
Php K8s
PHP K8s is a PHP handler for the Kubernetes Cluster API, helping you handling the individual Kubernetes resources directly from PHP, like viewing, creating, updating or deleting resources.
Stars: ✭ 111 (+428.57%)
Mutual labels:  api, sync
Remarkableapi
Docs and implementation of the reMarkable file sync API
Stars: ✭ 183 (+771.43%)
Mutual labels:  api, sync
Scobot
SCORM API for Content. JavaScript library, QUnit tests and examples.
Stars: ✭ 128 (+509.52%)
Mutual labels:  api, tools
Tutorialdb
A search 🔎 engine for programming/dev tutorials, See it in action 👉
Stars: ✭ 93 (+342.86%)
Mutual labels:  api, tools
Tools For Instagram
Automation scripts for Instagram
Stars: ✭ 274 (+1204.76%)
Mutual labels:  api, tools
Apidoc
RESTful API 文档生成工具,支持 Go、Java、Swift、JavaScript、Rust、PHP、Python、Typescript、Kotlin 和 Ruby 等大部分语言。
Stars: ✭ 785 (+3638.1%)
Mutual labels:  api, tools
Flickrsync
A command line tool to synchronise, upload, download, pictures between the local file system and Flickr. Image hash signature of the picture is used to uniquely identify the image.
Stars: ✭ 14 (-33.33%)
Mutual labels:  sync
Express Knex Objection
A simple API system on a pg database, using knex and objection to simplify connection and management
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Weixinbot
网页版微信API,包含终端版微信及微信机器人
Stars: ✭ 6,903 (+32771.43%)
Mutual labels:  api
Swiftinfo
📊 Extract and analyze the evolution of an iOS app's code.
Stars: ✭ 880 (+4090.48%)
Mutual labels:  tools
E Commerce 2 django
Guest register, user register, user login, user logout, account home page, product view history, change password, reset password, change name, send activation email when register, resend activation email, add shipping address, add billing address, add nickname to the addresses, edit shipping address, edit billing address, view list of your addresses, reuse shipping addresses when order products, reuse billing addresses when ordeer products, show sales analytics if staff or admin only using -chart.js-, get analytics data with Ajax, receive marketing email, change if user will receive marketing email or not by admin, send contact message with Ajax, products list, product detail, download product detail as a PDF file, download digital product files -if the user purchased that digital product only-, orders list, list of digital products files, order detail, download order detail as a PDF file, verify order ownership with Ajax -to secure order detail page-, show cart products, add or remove product from cart, checkout page, thanks page when order placed successfully, add or reuse payment method, add or reuse payment method with Ajax, search products by title, search products by description, search products by price, search products by tag title, write tags for products -by admin only-, auto fill contact email, full name if user logged in.
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Request.swift
A tiny HTTP client written in swift. URLSession alternative
Stars: ✭ 14 (-33.33%)
Mutual labels:  sync
Repos
Pull down a list of GitHub repos for the given user or org, and save to a local JSON file.
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Vdirsyncer
📇 Synchronize calendars and contacts.
Stars: ✭ 872 (+4052.38%)
Mutual labels:  sync
Shgf
Simple HTTP golang framework
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Eskom Loadshedding Api
Basic (in-progress) api to expose the eskom endpoints for loadshedding.
Stars: ✭ 21 (+0%)
Mutual labels:  api
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-4.76%)
Mutual labels:  api

@b1f6c1c4/hub-sync

npm npm GitHub last commit GitHub code size in bytes license

Sync your github forks without git in O(1) time, space, and network BW.

Basic usage

  1. Install the package with npm (nodejs package manager).

    npm i -g @b1f6c1c4/hub-sync
    
  2. Update your fork instantly. For the first time you run this, you will be asked to generate a GitHub Personal Access Token. Follow the instructions carefully and keep your token CONFIDENTIAL.

    hub-sync <name-of-your-fork-repository>
    

Advanced usage

  1. Update a certain branch:

    hub-sync <repo>/<branch>
    
  2. Update from another user's fork:

    hub-sync <your-repo> <another-user>
    
  3. Update from another user's fork, but with a different name:

    hub-sync <your-repo> <another-user>/<repo>
    
  4. Update from another user's fork, but with a different name and a different branch:

    hub-sync <your-repo>/<branch> <another-user>/<repo>/<branch>
    
  5. Point a branch of your repo to a specific SHA-1: (rarely used)

    hub-sync <your-repo>/<branch> <sha-1>
    
  6. Create a new branch:

    hub-sync -c <destination> <source>
    
  7. Update even if not fast-forward: (EXTREMELY DANGEROUS)

    hub-sync -f <destination> <source>
    
  8. Delete a branch: (EXTREMELY EXTREMELY DANGEROUS)

    hub-sync --delete <destination>
    
  9. See hub-sync --help for the complete usage documentation.

Notice: There is NO SAFETY NET at all for -f|--force and -d|--delete. YOU MAY LOSE ALL YOUR WORK ON THAT BRANCH IMMEDIATELY if not used properly. Neither Github nor the author of hub-sync will be responsible for your loss. USE AT YOUR OWN RISK. REFER TO THE LICENSE FOR LEGAL ISSUE.

Technical details

To keep your github fork up-to-date, the old-fashioned way is:

git clone https://github.com/<you>/<repo>
cd <repo>
git remote add upstream https://github.com/<other>/<repo>
git fetch upstream
git push origin upstream/master<master>
cd ..
rm -rf <repo>.git

However, this is totally pointless since you actually download all the data from github.com and upload all the way back. (I know git may be smart enough to upload only what github.com already has, but you have to download everything first.) This approach takes as bad as O(n) time, O(n) space, O(n) network bandwidth.

So the solution is to call Github API directly:

# Assuming you are using HTTPie:
http GET https://api.github.com/repos/<other>/<repo>/git/refs/heads/master
# Find object.sha, and
http PATCH https://api.github.com/repos/<you>/<repo>/git/refs/heads/master "Authorization<token> ..." sha=...
# If branch non-exist, use the following instead
http POST https://api.github.com/repos/<you>/<repo>/git/refs "Authorization<token> ..." sha=...

Now hub-sync does this for you, as smooth as O(1):

# This can be ran everywhere; it works without git.
hub-sync [-f|-c|-d] <you>/<repo>/<branch> <other>/<repo>/<branch>

Wanna take more control over the process, but not to clone everything?

You will need git-get and git-fancy-push. The latter one resolved the long-standing "shallow update not allowed" problem.

git get -g <you>/<repo>
git remote add upstream ...
git fancy-push upstream origin/master:master

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].