Git repositories on Google Cloud Storage

Git repositories, stored directly in Google Cloud Storage.

bgit lets you push code to a GCS bucket without running a Git server.

$ bgit clone gs://team/app.git --profile team-dev
Cloned gs://team/app.git into 'app'

$ cd app
$ bgit checkout -b feature/gcs-backend
$ bgit commit -am "Ship storage layer"
$ bgit push

Build from source

git clone https://github.com/bucketgit/bgit.git
cd bgit
go build -o bgit .

Install with Homebrew

brew tap bucketgit/bgit
brew install bgit

Authentication

Use the gcloud profile you already use.

bgit defaults to gcloud auth print-access-token. Use --profile for one command, or save the profile in the checkout with bgit config.

One command

bgit push --profile team-dev
bgit clone gs://team/repos/app.git --profile team-dev

Save it in the repo

bgit config bucketgit.auth gcloud
bgit config bucketgit.profile team-dev
bgit config bucketgit.profile

Create a profile

bgit create-gcloud-profile team-dev
bgit create-gcloud-profile --yes ci-profile

Use ADC when needed

bgit push --auth adc
bgit config bucketgit.auth adc

Native CLI

Git local work, GCS-backed remote state.

Local commands are implemented by bgit for normal checkout workflows. Remote commands read and write Git objects and refs directly through the GCS API.

Status

Stage, commit, inspect, and move through history without leaving the bgit CLI.

$ bgit status
 M README.md
?? docs/setup.md

Documentation

Run Git workflows on top of Google Cloud Storage.

bgit creates normal .git checkouts locally and stores remote Git objects, refs, branches, and tags in a GCS bucket prefix.

Install

Install with Homebrew, download a release binary, or build from source.

brew tap bucketgit/bgit
brew install bgit

bgit --version
git clone https://github.com/bucketgit/bgit.git
cd bgit
go build -o bgit .

Authentication

By default, bgit asks gcloud for an OAuth token with gcloud auth print-access-token. Use --profile to select a named gcloud configuration.

bgit clone gs://my-bucket/repositories/app.git --profile team-dev
bgit push --profile team-dev

Save auth defaults in a checkout:

bgit config bucketgit.auth gcloud
bgit config bucketgit.profile team-dev
bgit config bucketgit.profile

Create a gcloud profile and save it in the current checkout:

bgit create-gcloud-profile team-dev
bgit create-gcloud-profile --yes ci-profile

Use ADC explicitly for CI or service-account environments:

bgit push --auth adc
bgit config bucketgit.auth adc

Repositories

Repository URLs use the gs://bucket/path/repo.git form. The bucket is the GCS bucket name. The path is the repository prefix where bgit stores Git objects and refs.

bgit clone gs://my-bucket/repositories/app.git
bgit init
bgit origin gs://my-bucket/repositories/app.git
bgit push

bgit clone and bgit init create standard .git directories, so local tools can still inspect the checkout.

Commands

Local workflow

bgit status
bgit add -A
bgit commit -m "Update"
bgit diff
bgit show HEAD
bgit restore README.md
bgit reset --hard HEAD
bgit stash
bgit revert HEAD

Branches and tags

bgit checkout -b feature/gcs
bgit branch
bgit merge feature/gcs
bgit tag v0.3.0
bgit push --tags

Search and inspect

bgit grep bucketgit.profile
bgit blame README.md
bgit describe
bgit ls-files
bgit ls-tree -r HEAD
bgit archive HEAD > source.tar
bgit rev-parse HEAD

Remote GCS

bgit fetch
bgit pull
bgit push
bgit push --delete feature
bgit ls-remote
bgit --bucket my-bucket --prefix repositories/app.git log --limit 10
bgit --bucket my-bucket --prefix repositories/app.git cat README.md

Access Control

bgit admin grants bucket IAM using the selected auth mode. Run inside a checkout to infer the bucket, or pass --bucket.

bgit admin grant-read user:dev@example.com
bgit admin grant-write serviceAccount:ci@project.iam.gserviceaccount.com
bgit admin --bucket my-bucket grant-admin admin@example.com

Current Limits

rebase, server helpers, maintenance commands, and Git protocol server behavior are not implemented. Local merge, cherry-pick, revert, blame, and diff support focus on practical non-conflicting workflows rather than the complete Git porcelain surface.