Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 3.09 KB

File metadata and controls

103 lines (77 loc) · 3.09 KB

Branch

TensorBay supports diverging from the main line of development and continue to do work without messing with that main line. Like Git, the way Tensorbay branches is incredibly lightweight, making branching operations nearly instantaneous, and switching back and forth between branches generally just as fast. Tensorbay encourages workflows that branch often, even multiple times in a day.

Before operating branches, a dataset client instance with existing commit is needed.

../../../docs/code/branch.py

Create Branch

Create Branch on the Current Commit

TensorBay SDK supports creating the branch straightforwardly, which is based on the current commit.

../../../docs/code/branch.py

Then the dataset client will storage the branch name. "main" is the default branch, it will be created when init the dataset

../../../docs/code/branch.py

Create Branch on a Revision

Also, creating a branch based on a revision is allowed.

../../../docs/code/branch.py

The dataset client will checkout to the branch. The stored commit id is from the commit which the branch points to.

../../../docs/code/branch.py

Specially, creating a branch based on a former commit is permitted.

../../../docs/code/branch.py

Similarly, the dataset client will checkout to the branch.

../../../docs/code/branch.py

Then, through creating and committing the draft based on the branch, diverging from the current line of development can be realized.

../../../docs/code/branch.py

List Branches

../../../docs/code/branch.py

Get Branch

../../../docs/code/branch.py

Delete Branch

../../../docs/code/branch.py