Skip to main content

A bitbucket server helper for working with lots of repos.

Project description

#bitbucket-helper

A command-line utility for working with lots of bitbucket server projects and repositories.

The helper allows you to clone or pull every bitbucket repository you have access too. Repositories are pathed under their parent project, making it easy to identify the source project.

Installation

The utility requires python3.7

pip install bitbucket-helper

Setup

The first time you attempt to sync, you will get prompted to provide your bitbucket details. The tool supports both Bitbucket server and Bitbucket cloud.

Bitbucket server requires a read-only personal access token. To generate go to Bitbucket -> Manage account -> Personal Access Tokens.

Bickbucket cloud requires an App Password if you use 2FA. The App must be granted Team Membership -> Read, Projects -> Read

All configuration settings get stored in ~/.bitbucket-helper.config. To reconfigure you can delete this file.

Listing Repositories

You can list all of the repositories you have permission to access with:

bitbucket-helper list

The command outputs the following quoted comma-separated values:

"project_key","clone_uri"

Synchronising

The synchronisation function uses bitbucket APIs to get all accessible projects and repositories. For each project, it will create a directory using its key. For each repository, we perform a git clone or a git pull if we already have a local copy. After the pull, we prune and delete local branches that have been merged at the origin.

Local directory structure:

  • working_directory (~/bitbucket)
    • proj1
      • repo1
      • repo2
    • proj2
      • repo1
      • repo2
bitbucket-helper sync

Git log commands

Bitbucket helper makes it easy to search for commits across all of your repositories using simple filters. Log commands operate on locally synched repositories, so remember to do a bitbucket-helper sync first.

You can find all commits after a specified date using:

bitbucket-helper log --after=2020-03-02

To search from commits between two tags:

bitbucket-helper log --from_tag=1.9.0 --to_tag=1.9.1

The command outputs the following quoted comma-separated values:

"repo","commit_hash","unix_time","iso_date","commit_message","author"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitbucket-helper-0.0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitbucket_helper-0.0.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file bitbucket-helper-0.0.5.tar.gz.

File metadata

  • Download URL: bitbucket-helper-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for bitbucket-helper-0.0.5.tar.gz
Algorithm Hash digest
SHA256 7eadf0e6bf49fd6550c3700afbbd09e190bd16ee87039b8012c319b1a9b98a88
MD5 9fc69efa8d860d14bd07d8ea04cb1063
BLAKE2b-256 a6e32bc2c495f7df71bb55779c9ca990c0a019346fad23e4b724e10b350c0714

See more details on using hashes here.

File details

Details for the file bitbucket_helper-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: bitbucket_helper-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for bitbucket_helper-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6965e20317ae344ac5817f9b8c458660bf75b92c7c97f1d02ef85de9e1d73de2
MD5 a44b5873f006fd99ee18a3a22c5daecc
BLAKE2b-256 3a10ad8671c5d357b1ff92776a0e7461b260472ecf33346489be66702e091ebd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page