ローカルに作ったレポジトリをBitbucket上で管理する方法

ローカルで管理してたレポジトリをBitbucketで管理する為の方法を書く。
基本的には下記にあるようなローカルのリポジトリGithubで管理するのと同じで良く、もしくはBitbucket上でリポジトリを作成した時に表示される[Overview]->[Get started]->[I have an existing project to push up]に記載されてる方法に従えばOK。
ローカルで作ったリポジトリをgithubに初めてpushする方法 - 未来のいつか/hyoshiokの日記

まずローカルにリポジトリがあるとする。

git init
git add .
git commit -m 'Initial Commit'

ここで、Bitbuckt上で次のようなリポジトリを作成する。

ローカルのリポジトリ上で次を実行すると、ローカルにある全てのBranchがBitbucket上で送られ管理される。

cd /path/to/repository
git remote add origin https://account_name@bitbucket.org/account_name/repository_name.git
git push -u origin --all
git push -u origin --tag

特定のBranch例えばmasterのみをあげたい場合は

cd /path/to/repository
git remote add origin https://account_name@bitbucket.org/account_name/repository_name.git
git push -u origin master

とすれば良い。