Build from source
git clone https://github.com/bucketgit/bgit.git
cd bgit
go build -o bgit .
Git repositories on 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
git clone https://github.com/bucketgit/bgit.git
cd bgit
go build -o bgit .
brew tap bucketgit/bgit
brew install bgit
Authentication
bgit defaults to gcloud auth print-access-token.
Use --profile for one command, or save the profile in
the checkout with bgit config.
bgit push --profile team-dev
bgit clone gs://team/repos/app.git --profile team-dev
bgit config bucketgit.auth gcloud
bgit config bucketgit.profile team-dev
bgit config bucketgit.profile
bgit create-gcloud-profile team-dev
bgit create-gcloud-profile --yes ci-profile
bgit push --auth adc
bgit config bucketgit.auth adc
Native CLI
Local commands are implemented by bgit for normal
checkout workflows. Remote commands read and write Git objects and
refs directly through the GCS API.
Stage, commit, inspect, and move through history without leaving the bgit CLI.
$ bgit status
M README.md
?? docs/setup.md
Documentation
bgit creates normal .git checkouts locally
and stores remote Git objects, refs, branches, and tags in a GCS
bucket prefix.
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 .
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
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.
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
bgit checkout -b feature/gcs
bgit branch
bgit merge feature/gcs
bgit tag v0.3.0
bgit push --tags
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
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
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
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.