Skip to content

Commit f05bbaf

Browse files
committed
Working with Branches in Taubyte
1 parent 8aaa49f commit f05bbaf

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

content/posts/branches-taubyte.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: "Working with Branches in Taubyte"
3+
author: Zaoui Amine
4+
featured: true
5+
draft: false
6+
tags:
7+
- tutorials
8+
- branches
9+
- git
10+
- development
11+
- cloud
12+
image:
13+
src: /blog/images/branches-taubyte.png
14+
alt: Working with Branches in Taubyte
15+
summary: Follow best practices for feature development by using Git branches with Taubyte. Learn how to run Dream on development branches, create new branches in the console, and merge changes to production.
16+
date: 2026-01-14T20:00:00Z
17+
categories: [Hand-on Learning]
18+
---
19+
20+
When working with projects, the best practice is to create a **new branch for each feature or bug fix**. This way, you can work in isolation without touching the main branch until your work is ready to merge.
21+
22+
Both **Tau** and **Dream** support running on branches.
23+
24+
## Default Behavior
25+
26+
By default:
27+
- **Tau** (production) runs on `main` and `master` branches
28+
- **Dream** (local) also defaults to these branches
29+
30+
But you can configure either to run on any branch.
31+
32+
## Starting Dream on a Branch
33+
34+
To start Dream on a specific branch, use the `-b` flag:
35+
36+
```bash
37+
dream new multiverse -b dev
38+
```
39+
40+
This starts a Dream universe that listens for changes on the `dev` branch instead of `main`.
41+
42+
## Connecting to Your Branch Universe
43+
44+
Once Dream is running on your branch, connect through the web console:
45+
46+
1. Open [console.taubyte.com](https://console.taubyte.com)
47+
2. Connect to your Dream universe (should be named `blackhole`)
48+
3. Either create a new project or import an existing one
49+
50+
## The Branch Creation Flow
51+
52+
Here's a common scenario: you start Dream on a development branch that doesn't exist yet on the remote repository.
53+
54+
### Initial Attempt
55+
56+
Trigger a build:
57+
58+
```bash
59+
dream inject push-all
60+
```
61+
62+
You might see an error in Dream logs:
63+
64+
```bash
65+
Check out 'dev' failed with reference not found
66+
```
67+
68+
**This happens because the `dev` branch doesn't exist on the remote repository yet.**
69+
70+
### Creating the Branch
71+
72+
To fix this, create the branch in the console:
73+
74+
1. In the top right corner, click the **current branch name** (shows `main`)
75+
2. Click the **+** button
76+
3. Type `dev` as the new branch name
77+
4. Click **Validate**
78+
79+
The console will refresh and show the branch name changed to `dev`.
80+
81+
### Building Successfully
82+
83+
Now trigger the build again:
84+
85+
```bash
86+
dream inject push-all
87+
```
88+
89+
This time it should **succeed**. If you imported a project with existing functions, they'll be built on this branch.
90+
91+
## Commands Reference
92+
93+
| Command | Description |
94+
|---------|-------------|
95+
| `dream new multiverse` | Start Dream on default branch (main) |
96+
| `dream new multiverse -b dev` | Start Dream on `dev` branch |
97+
| `dream inject push-all` | Trigger builds for all repos |
98+
99+
## Troubleshooting
100+
101+
| Issue | Cause | Solution |
102+
|-------|-------|----------|
103+
| "Reference not found" | Branch doesn't exist on remote | Create branch in console |
104+
| Wrong branch building | Dream started on different branch | Restart Dream with correct `-b` flag |
105+
| Changes not appearing | Built on wrong branch | Verify console shows correct branch |
106+
107+
## Best Practices
108+
109+
1. **Never develop directly on main**: Always use feature branches
110+
2. **Name branches descriptively**: `feature/user-auth`, `fix/login-bug`
111+
3. **Test locally first**: Use Dream to validate before merging
112+
4. **Keep branches short-lived**: Merge frequently to avoid conflicts
113+
5. **Delete merged branches**: Keep your repository clean
114+
115+
## Conclusion
116+
117+
You've learned how to:
118+
119+
1. **Start Dream on specific branches** with the `-b` flag
120+
2. **Create branches** from the console
121+
3. **Build and test** on feature branches
122+
4. **Merge to production** when ready
123+
124+
Branching enables safe, isolated development that follows industry best practices. You can experiment freely knowing your main branch stays stable until you're ready to merge.
125+
126+
Next, learn how to [ship to production](/blog/posts/ship-to-production-taubyte) when your project is ready.
127+

0 commit comments

Comments
 (0)