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 clone, you will get prompted to provide your bitbucket server hostname, username, a personal access token and a working directory where projects will get cloned.

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

bitbucket-helper sync

[Bitbucket server hostname]: myserver.domain    
[Bitbucket username]: myusername
[Personal access token]: secret
[Working directory (defaults to ~/bitbucket/)]: 
[Clone using http or ssh]: http

All configuration settings get stored in ~/.bitbucket-helper.config.

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.4.tar.gz (4.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: bitbucket-helper-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 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.4.tar.gz
Algorithm Hash digest
SHA256 2edac98becb67f2c9964cf053c6572d832c3dd1a626c2eab6589ca47583b70ab
MD5 0cc38a7eb4133fd57c79984bdb33a04d
BLAKE2b-256 32e70775c272fa4c2c0136052cf2701f722a46db88f36f9981116a7913f67d23

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