Skip to main content

A bitbucket server helper for working with lots of repos.

Project description

bitbucket-helper

Bitbucket-helper is a command-line utility for working with lots of bitbucket server projects and repositories. This handy 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 goto Bitbucket -> Manage account -> Personal Access Tokens.

BitBucket Cloud requires an App Password if you use 2FA. The App needs to be granted read access.

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

Listing Repositories

To list all of the repositories, you have permission to access:

bitbucket-helper repo

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-server)
    • proj1
      • repo1
      • repo2
    • proj2
      • repo1
      • repo2
bitbucket-helper sync

Pull requests

Bitbucket helper can list pull requests across all of your repositories. By default it returns OPEN pull requests, you can also filter for pull requests in a specific state, e.g. ALL, OPEN, MERGED, DECLINED.

bitbucket-helper pr --state=MERGED

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

Find out more

You can find out more here

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.1.2.tar.gz (6.9 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.1.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitbucket-helper-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for bitbucket-helper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2a175b2b0278141d05ef2c75aed5951ef8df413f0ca1bafee3387b112610a984
MD5 7e0e652cf60054829c6e6681069a44af
BLAKE2b-256 a35c95110aef29f1a707c2cca0dd080b21795cd8decf6b47b09343c87c6efc85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitbucket_helper-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for bitbucket_helper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d12957230216e186809af40f8a044c8fcfdbeff34ca8f38fe2b00dd437e2a91d
MD5 85137ea71d8282a136a30c3115f9f5a0
BLAKE2b-256 3264e00ef6a3ff5cbeef07c0df8a9d3c053961a558eda99931ac4cd15a16f76e

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