6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WanoグループAdvent Calendar 2017

Day 24

command lineでbitbucket pull request

Last updated at Posted at 2017-12-23

この記事は Wanoグループ Advent Calendar 2017の24日目の記事になります。

bitbucketとgit hub同じように、pull requestsの機能がある。
しかし実際使うの時、web UIの操作はけっこう重いと思いますので、出来ればcommand lineの操作したいです。

まずは調べで、Bitbucket Server Command Line Tools発見しました。
最初は入れる簡単と思うけど、うまく行けなかった。どうしていけないのと思うの時、一番上のお知らせ気づきました。"This command line tool is a utility for Bitbucket Server (where you download and host bitbucket yourself). If you are a user of Bitbucket Cloud (bitbucket.org) then this tool is not for you."。。。私はbitbucket.org使うので、悲しい。

別の方法探すと、もう一個のsolutionあった、bitkucket-cli。

まずinstallします:

pip install bitbucket-cli

configファイルの設定 (~/.bitbucket):

[auth]
username = < Your Username >
password = < Your Password > #設定しないも大丈夫

[options]
scm = <'git' or 'hg'>
protocol = <'https' or 'ssh'> # 実際はBitbucket REST API今https対応のみらしい、ここでhttpsしてください。

使うの時めちゃ簡単:

//bb pull_request --owner XXX source_branch destination_branch
bb pull_request --owner Johnny develop master

結果:
Pull request successfully opened.
Link: http://bitbucket.org/XXXX/test_project/pull-requests/1

参考記事:
https://bitbucket.org/zhemao/bitbucket-cli
https://bitbucket.org/atlassian/bitbucket-server-cli

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?