Branching with BK

Yes, git allows lightweight branches by allowing a single repository to contain multiple open tips of the revision history graph. It also allows quickly switching between those tips in place.

In bk, a single repository can only have a single tip and so to track multiple tips you need multiple repositories. This is less flexible than git’s approach but not any less powerful. Which is to say there isn’t a workflow that git allows that can’t be done in bk.

The biggest difference is if your project takes a long time to build and you have not included any derived object caching in your build solution, then switching tips in-place might save time rebuilding.

So if you are working on the new release and a bugfix comes in for the last release the workflow would look something like this.

git

(apologies if I get some git syntax wrong, I am not an expert. :wink: )

$ git stash
$ git checkout -b bk-7.2.1.fixbug bk-7.2.1

... develop and fix bug ...

$ git add -A
$ git commit
$ git push <somewhere>

$ git checkout master
$ git stash pop

... continue working ...

bk

$ bk clone -rbk-7.2.1 . ../bk-7.2.1.fixbug
$ cd ../bk-7.2.1.fixbug

... develop and fix bug ...

$ bk citool
$ bk push bk://machine/bk-7.1.x
$ cd ../original-repo

... continue working ...

Of course, a git user can use multiple repos the same way as bk, but the difference isn’t really that big.

That said we have been working on supporting multiple tips in bk, but that code is not yet ready for public consumption.