{"id":13484725,"url":"https://github.com/bgahagan/git-remote-s3","last_synced_at":"2025-04-04T11:14:10.962Z","repository":{"id":35156567,"uuid":"211581124","full_name":"bgahagan/git-remote-s3","owner":"bgahagan","description":"Push and pull git repos to/from an s3 bucket, encrypted using gpg.","archived":false,"fork":false,"pushed_at":"2023-06-06T23:20:53.000Z","size":103,"stargazers_count":304,"open_issues_count":9,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T08:16:14.462Z","etag":null,"topics":["command-line-tool","git","gpg","gpg-encryption","rust","s3"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgahagan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-29T01:05:32.000Z","updated_at":"2024-10-23T10:28:45.000Z","dependencies_parsed_at":"2024-06-20T15:53:35.043Z","dependency_job_id":null,"html_url":"https://github.com/bgahagan/git-remote-s3","commit_stats":{"total_commits":25,"total_committers":5,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"b0ca74d4018e5585f91c7d4c8506ee8deee483a6"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgahagan%2Fgit-remote-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgahagan%2Fgit-remote-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgahagan%2Fgit-remote-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgahagan%2Fgit-remote-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgahagan","download_url":"https://codeload.github.com/bgahagan/git-remote-s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","git","gpg","gpg-encryption","rust","s3"],"created_at":"2024-07-31T17:01:31.649Z","updated_at":"2025-04-04T11:14:10.939Z","avatar_url":"https://github.com/bgahagan.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"Git Remote S3 Helper\n====================\n\nPush and pull git repos to/from an s3 bucket.\nUses gpg to encrypt the repo contents (but not branch names!) before sending\nto s3.\n\nThis likely most useful for small teams who don't want to host their own\nprivate repository, but still want to manage their own encryption.\nFor example, my use case is periodically backing up a repo from a desktop\nand pull to a laptop to develop remotely.\n\n\nExample Usage\n-------------\n\nAdd a remote using the `s3` transport:\n```\ngit remote add s3remote s3://my_bucket/prefix\n```\n\nAnd then you can push/pull to the remote as usual:\n\n```\ngit pull s3remote master\n\ngit push s3remote\n```\n\nOr even clone from s3:\n```\ngit clone s3://my_bucket/prefix\n```\n\n\nInstallation\n------------\n\n* Put `git-remote-s3` in your PATH\n  * Download the latest release [here](https://github.com/bgahagan/git-remote-s3/releases/latest), gunzip and put it in your PATH\n  * Or, install using cargo: `cargo install git-remote-s3`\n* Make sure s3 credentials are setup\n  * See [here](https://docs.rs/rusoto_credential/0.40.0/rusoto_credential/struct.ChainProvider.html) for details on how the rusoto library loads as credentials (similar to the aws command line).\n* Setup gpg\n  * gpg encryption will be attempted using `git config user.email` as a recipient. You'll want to ensure you have public and private keys setup for this user.\n  * Alternatively, you can set a list of space-delimited recipients using the `remote.\u003cname\u003e.gpgRecipients`config.\n\nDesign Notes\n------------\nDue to the eventual consistency behaviour of s3, the semantics of pushing are\nslightly different when pushing to a 'proper' git repository.\nAn attempt is made to prevent non-force pushes that do not include the current\nhead as an ancestor (as proper git repos do), but eventual consistency means\nthis is not guaranteed.\nIts possible for multiple heads to exist for the same branch, in which case\nthe clients consider the newest head to be the truth.\nAll heads for a branch can be seen using `git ls-remote` - the latest (newest)\nhead the have the branch's name; older head will be shown using the naming\nscheme: `\u003cbranch_name\u003e__\u003csha\u003e`.\nAn old head is retained until a new head is pushed that includes the old head\nas an ancestor, at which point the old head is deleted.\nThis prevents any data loss, but puts the burden on the user to manually merge\nin old branches.\n\nEach branch is stored (after being bundled with `git bundle` and encrypted with\n`gpg`) on s3 using the key `s3://bucket/prefix/\u003cref_name\u003e/\u003csha\u003e.bundle`.\nOn average, a `git push` will incur two list, a put and a delete s3 operation.\nA `git pull` will incur a list and a get s3 operation.\n\n\nFuture improvements\n-------------------\n\n* A better way to notify the user there are multiple heads on s3.\n  * Show warning when attempting to push/fetch and there are multiple heads for a branch?\n* Allow disabling gpg with `remote.\u003cname\u003e.gpg`\n* use `gpg.program`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgahagan%2Fgit-remote-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgahagan%2Fgit-remote-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgahagan%2Fgit-remote-s3/lists"}