https://github.com/b1f6c1c4/hub-sync

Sync your github forks without git.

https://github.com/b1f6c1c4/hub-sync

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

api git github hub-sync sync tools

Keywords from Contributors

projection interactive archival generic sequences observability autograding hacking shellcodes modular
Last synced: 5 months ago · JSON representation

Repository

Sync your github forks without git.

Basic Info
Statistics
  • Stars: 24
  • Watchers: 3
  • Forks: 1
  • Open Issues: 4
  • Releases: 2
Topics
api git github hub-sync sync tools
Created almost 8 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

@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).

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

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

Advanced usage

  1. Update a certain branch:

    bash hub-sync <repo>/<branch>

  2. Update from another user's fork:

    bash hub-sync <your-repo> <another-user>

  3. Update from another user's fork, but with a different name:

    bash hub-sync <your-repo> <another-user>/<repo>

  4. Update from another user's fork, but with a different name and a different branch:

    bash hub-sync <your-repo>/<branch> <another-user>/<repo>/<branch>

  5. Point a branch of your repo to a specific SHA-1: (rarely used)

    bash hub-sync <your-repo>/<branch> <sha-1>

  6. Create a new branch:

    bash hub-sync -c <destination> <source>

  7. Update even if not fast-forward: (EXTREMELY DANGEROUS)

    bash hub-sync -f <destination> <source>

  8. Delete a branch: (EXTREMELY EXTREMELY DANGEROUS)

    bash 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: sh 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: ```sh

Assuming you are using HTTPie:

http GET https://api.github.com/repos///git/refs/heads/master

Find object.sha, and

http PATCH https://api.github.com/repos///git/refs/heads/master "Authorization ..." sha=...

If branch non-exist, use the following instead

http POST https://api.github.com/repos///git/refs "Authorization ..." sha=... ```

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

This can be ran everywhere; it works without git.

hub-sync [-f|-c|-d] // // ```

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. bash git get -g <you>/<repo> git remote add upstream ... git fancy-push upstream origin/master:master

License

MIT

Owner

  • Login: b1f6c1c4
  • Kind: user
  • Location: NJ, USA
  • Company: Princeton University

52BE D143 A92D BE96 2B83 092B 9BAC 0164 9600 1E70

GitHub Events

Total
  • Delete event: 2
  • Push event: 2
  • Pull request event: 5
  • Create event: 3
Last Year
  • Delete event: 2
  • Push event: 2
  • Pull request event: 5
  • Create event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 40
  • Total Committers: 2
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.325
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
b1f6c1c4 b****4@g****m 27
dependabot[bot] 4****] 13

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 4
  • Total pull requests: 16
  • Average time to close issues: 23 days
  • Average time to close pull requests: 9 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.06
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 15
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 6 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • b1f6c1c4 (3)
  • IoriOikawa (1)
Pull Request Authors
  • dependabot[bot] (17)
  • b1f6c1c4 (1)
Top Labels
Issue Labels
enhancement (2) dependencies (1) bug (1)
Pull Request Labels
dependencies (17) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 45 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
npmjs.org: @b1f6c1c4/hub-sync

Sync your github forks without git.

  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 45 Last month
Rankings
Stargazers count: 7.5%
Dependent repos count: 10.3%
Forks count: 11.6%
Dependent packages count: 20.9%
Average: 22.1%
Downloads: 60.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

package-lock.json npm
  • @types/color-name 1.1.1
  • ansi-regex 4.1.0
  • ansi-styles 3.2.1
  • ansi-styles 4.2.1
  • axios 0.21.2
  • camelcase 5.3.1
  • chalk 4.1.0
  • cliui 5.0.0
  • color-convert 2.0.1
  • color-convert 1.9.3
  • color-name 1.1.4
  • color-name 1.1.3
  • cross-spawn 6.0.5
  • debug 4.1.1
  • decamelize 1.2.0
  • emoji-regex 7.0.3
  • end-of-stream 1.4.1
  • execa 1.0.0
  • find-up 3.0.0
  • follow-redirects 1.14.8
  • get-caller-file 2.0.5
  • get-stream 4.1.0
  • has-flag 4.0.0
  • invert-kv 2.0.0
  • is-fullwidth-code-point 2.0.0
  • is-stream 1.1.0
  • isexe 2.0.0
  • lcid 2.0.0
  • locate-path 3.0.0
  • map-age-cleaner 0.1.3
  • mem 4.3.0
  • mimic-fn 2.1.0
  • ms 2.1.2
  • nice-try 1.0.5
  • npm-run-path 2.0.2
  • once 1.4.0
  • os-locale 3.1.0
  • p-defer 1.0.0
  • p-finally 1.0.0
  • p-is-promise 2.1.0
  • p-limit 2.2.0
  • p-locate 3.0.0
  • p-try 2.2.0
  • path-exists 3.0.0
  • path-key 2.0.1
  • pump 3.0.0
  • require-directory 2.1.1
  • require-main-filename 2.0.0
  • semver 5.7.0
  • set-blocking 2.0.0
  • shebang-command 1.2.0
  • shebang-regex 1.0.0
  • signal-exit 3.0.2
  • string-width 3.1.0
  • strip-ansi 5.2.0
  • strip-eof 1.0.0
  • supports-color 7.1.0
  • which 1.3.1
  • which-module 2.0.0
  • wrap-ansi 5.1.0
  • wrappy 1.0.2
  • y18n 4.0.1
  • yargs 13.2.4
  • yargs-parser 13.1.2
package.json npm
  • axios ^0.21.1
  • chalk ^4.1.0
  • debug ^4.1.1
  • yargs ^13.2.4