since 2010-12-18
http://doc.bazaar.canonical.com/migration/en/survival/bzr-for-git-users.html
に基づいて考察。
Create a new project
To create a standalone branch looks very similar to git:
$ bzr init myproject
However, to create the recommended Bazaar repository/branch structure is slightly more complex:
$ bzr init-repo myproject $ cd myproject $ bzr init trunk
## by nishimotz $ cd trunk $ echo "hello" > hello.txt $ bzr add hello.txt $ bzr commit -m "initial"
Clone a branch
Creating a copy of a branch (whether a clone of a remote branch, or a branch of a local one) is similar to git, but using the branch command rather than clone (for convenience “clone” is aliased to “branch”):
$ cd .. # operate on branches from the shared repository $ bzr branch trunk feature-a
以下は Windows での bzr info の実行結果。
myproject は shared repository となっており、trunk と feature-a が myproject を共有している。そして feature-a の parent は trunk になっている。
C:\work\_bzr\myproject>bzr info Shared repository with trees (format: 2a) Location: shared repository: . C:\work\_bzr\myproject>cd trunk C:\work\_bzr\myproject\trunk>bzr info Repository tree (format: 2a) Location: shared repository: C:/work/_bzr/myproject repository branch: . C:\work\_bzr\myproject\trunk>cd .. C:\work\_bzr\myproject>cd feature-a C:\work\_bzr\myproject\feature-a>bzr info Repository tree (format: 2a) Location: shared repository: C:/work/_bzr/myproject repository branch: . Related branches: parent branch: C:/work/_bzr/myproject/trunk