Skip to content

Commit e0d41c5

Browse files
authored
Merge pull request #38 from FlutterFlow/feature/git-integration
Add Git integration
2 parents 6372013 + 8e39448 commit e0d41c5

File tree

7 files changed

+339
-0
lines changed

7 files changed

+339
-0
lines changed

docs/integrations/git.md

Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
---
2+
slug: /integrations/git
3+
title: Git
4+
description: Learn how to connect your Dreamflow project with Git providers and perform Git operations.
5+
tags: [Git, Integration, Dreamflow]
6+
sidebar_position: 3
7+
toc_max_heading_level: 4
8+
keywords: [git, Integration, Dreamflow, Version Control, Source Control]
9+
---
10+
11+
# Git
12+
13+
Dreamflow supports Git integration, allowing you to connect your projects directly to GitHub, GitLab, or other Git providers.
14+
15+
:::info
16+
Git integration is only available for users on the **Pro plan and above**.
17+
:::
18+
19+
## Connect Repository
20+
21+
You can connect a repository in two main ways:
22+
23+
- **Clone Codebase**: Use this option when you want to start a new project from an existing Flutter app.
24+
25+
- **Connect Project to Git**: Use this option when you already have a project in Dreamflow and want to link it to a Git repository.
26+
27+
:::warning
28+
29+
Currently, Dreamflow does not support multi-user collaboration within the same repository. If multiple Dreamflow projects attempt to use the same repo, the system will detect and restrict it.
30+
31+
For team collaboration, please reach out regarding the [**Enterprise Plan**](https://dreamflow.app#pricing).
32+
33+
:::
34+
35+
### Clone Codebase
36+
37+
To clone a codebase:
38+
39+
1. Go to the [**Dreamflow Dashboard**](https://app.dreamflow.com/dashboard) and select **Clone Codebase**.
40+
2. In the dialog box, enter the following details:
41+
- **Project Name** – Choose a name for your Dreamflow project.
42+
- **Repository URL** – Paste the HTTPS URL of your Git repository (e.g., `https://github.com/username/repo.git`).
43+
- **Access Token** – Enter your personal access token. Refer to the [**Get Access Token**](#get-access-token) for more information on how to generate one.
44+
3. Once all fields are filled in, click **Clone Repository**.
45+
46+
Dreamflow will then clone the repository, import your Flutter project files, and automatically open it in your workspace for editing.
47+
48+
Here’s an example of cloning a repository from GitHub:
49+
50+
<div style={{
51+
position: 'relative',
52+
paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
53+
height: 0,
54+
width: '100%'}}>
55+
<iframe
56+
src="https://demo.arcade.software/kUa2NnyUeTHlPsjdfl3B?embed&show_copy_link=true"
57+
title=""
58+
style={{
59+
position: 'absolute',
60+
top: 0,
61+
left: 0,
62+
width: '100%',
63+
height: '100%',
64+
colorScheme: 'light'
65+
}}
66+
frameborder="0"
67+
loading="lazy"
68+
webkitAllowFullScreen
69+
mozAllowFullScreen
70+
allowFullScreen
71+
allow="clipboard-write">
72+
</iframe>
73+
</div>
74+
<p></p>
75+
76+
:::warning
77+
78+
Dreamflow currently supports **Flutter repositories only**. If your repository contains non-Flutter code or multiple projects (like a monorepo), the import may fail.
79+
80+
Support for monorepos is planned for a future update.
81+
82+
:::
83+
84+
#### Project Import Requirements
85+
86+
When importing an existing repo into Dreamflow, Dreamflow expects:
87+
88+
1. **Flutter app:** Dreamflow checks for a `pubspec.yaml` file. If not found, import fails because the repository is not recognized as a Flutter project.
89+
- **Monorepos** - repositories containing multiple nested Flutter projects - aren’t supported yet, but support is on our roadmap.
90+
2. **Web Support**: Dreamflow requires apps to run in the **web preview environment**. Repos using packages that break web may fail to load or run incorrectly.
91+
- The Dreamflow preview uses Flutter's canvaskit renderer. If the project specifically uses the HTML renderer setting, the preview may not load
92+
93+
There are a few other things that might go wrong when importing an existing Flutter repo:
94+
95+
- **Unsupported Flutter Version**: If the project uses a Flutter version Dreamflow does not support, import will fail with an error. There are also cases where implicit version ranges cause analyzer issues due to breaking Flutter changes.
96+
- **Theme Issues** : Certain theme configurations might not render properly in the Dreamflow editor - you may not see all of your colors or text styles in the Theme panel.
97+
- **Local Servers / Background Processes**: Projects requiring local API servers or background processes during development will fail to run inside Dreamflow.
98+
- **Private Dependencies**: If the project depends on packages hosted in private servers that Dreamflow cannot access, the import will fail.
99+
- **Code Generation Tools** (build_runner, freezed, flutter_localizations): You cannot currently execute scripts inside of the Dreamflow builder. If the imported project depends on code generation, you will need to generate Dart files outside of Dreamflow and commit them to the repo.
100+
- **`-dart-define` Requirements**: You must provide a default configuration so the app can run without requiring any --dart-define parameters.
101+
- **Project May Be Too Large**: Very large repositories may take a long time to start and you may see some performance degradation in the Dreamflow builder.
102+
103+
### Connect Project to Git
104+
105+
To connect a Dreamflow project to Git repo:
106+
107+
1. Open your existing project in Dreamflow. Go to the **Source Control Panel** on the left sidebar and click **Connect Repository**.
108+
2. In the dialog, provide:
109+
1. **Repository URL** – Paste the HTTPS URL of your new blank repository. If you haven’t already created one, you can create a new repository on your Git provider (such as [GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository)) before proceeding.
110+
2. **Access Token** – Enter your personal Git access token. Refer to the [**Get Access Token**](#get-access-token) for more information on how to generate one.
111+
3. Click **Connect**.
112+
113+
Once connected, Dreamflow will automatically start tracking file changes, which you can view in the **Changes** list.
114+
115+
:::warning
116+
117+
The repository must be blank or contain only a README and/or LICENSE file.
118+
119+
:::
120+
121+
Here’s an example of connecting a project to a repository hosted on GitHub:
122+
123+
<div style={{
124+
position: 'relative',
125+
paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
126+
height: 0,
127+
width: '100%'}}>
128+
<iframe
129+
src="https://demo.arcade.software/sVeZ20PpJwRrMpUwTJ6I?embed&show_copy_link=true"
130+
title=""
131+
style={{
132+
position: 'absolute',
133+
top: 0,
134+
left: 0,
135+
width: '100%',
136+
height: '100%',
137+
colorScheme: 'light'
138+
}}
139+
frameborder="0"
140+
loading="lazy"
141+
webkitAllowFullScreen
142+
mozAllowFullScreen
143+
allowFullScreen
144+
allow="clipboard-write">
145+
</iframe>
146+
</div>
147+
<p></p>
148+
149+
### Get Access Token
150+
151+
To connect with your Git provider, you’ll need to generate a **Personal Access Token (PAT)**. This token allows Dreamflow to authenticate and securely interact with your repository.
152+
153+
#### For GitHub
154+
155+
Follow these official GitHub guides to create a Personal Access Token:
156+
157+
- [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
158+
- [Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)
159+
- [Creating a classic personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)
160+
161+
**Required Scopes for Dreamflow:**
162+
163+
- For **Fine-grained tokens:** Grant **Content: Read & Write** access to the specific repository you plan to use.
164+
- For **Classic tokens:** Enable **repo** and **workflow** permissions.
165+
166+
#### For GitLab
167+
168+
You can generate a Personal Access Token directly from your GitLab account by following the official documentation:
169+
170+
- [GitLab: Create a personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)
171+
172+
**Required Scopes for Dreamflow:**
173+
174+
- `api`: Full API access.
175+
- `read_repository` and `write_repository` to read and write code to your repository.
176+
177+
Once your token is created, copy it and paste it into the **Access Token** field when connecting your repository in Dreamflow.
178+
179+
## Git Operations
180+
181+
This section walks you through how to perform common Git operations like branching, committing, and syncing your code.
182+
183+
### Branching
184+
185+
You can easily manage branches directly within the platform, i.e., create new ones, switch between existing ones, and refresh your branch list when needed.
186+
187+
#### Create a New Branch
188+
189+
You can create a new branch to work on a specific feature or fix without affecting the `main` branch.
190+
191+
To create a new branch:
192+
193+
1. Open the **branch dropdown** in the **Source Control panel** and choose the branch you want to create your new branch from (e.g., `main`).
194+
2. Click the **+** button on the right side of the panel.
195+
3. In the dialog, enter a name for your new branch (for example, `feature/user-profile`).
196+
4. Click **Save**.
197+
198+
Once created, Dreamflow will automatically switch your workspace to the new branch.
199+
200+
<div style={{
201+
position: 'relative',
202+
paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
203+
height: 0,
204+
width: '100%'}}>
205+
<iframe
206+
src="https://demo.arcade.software/EJWEpo1PSAo6xE5ow1e0?embed&show_copy_link=true"
207+
title=""
208+
style={{
209+
position: 'absolute',
210+
top: 0,
211+
left: 0,
212+
width: '100%',
213+
height: '100%',
214+
colorScheme: 'light'
215+
}}
216+
frameborder="0"
217+
loading="lazy"
218+
webkitAllowFullScreen
219+
mozAllowFullScreen
220+
allowFullScreen
221+
allow="clipboard-write">
222+
</iframe>
223+
</div>
224+
<p></p>
225+
226+
#### View and Switch Branches
227+
228+
You can view all available branches in the dropdown menu in the **Source Control panel**. To switch branches, simply open the dropdown and select the branch you want to work on.
229+
230+
![switch-branch.avif](imgs/switch-branch.avif)
231+
232+
#### Refresh Branch List
233+
234+
If you’ve created or deleted branches outside of Dreamflow, click the **Refresh Branches** icon beside the dropdown. This updates your local list so you always see the latest branches available in your remote repository.
235+
236+
![refresh-branch.avif](imgs/refresh-branch.avif)
237+
238+
### Push Changes
239+
240+
To push changes from your project to the remote repository:
241+
242+
1. Make edits to your app.
243+
2. Check **Source Control > Changes**. The modified file will be tagged **M** and listed there.
244+
3. (Optional) Click **View Diff** to compare your edit with the previous version.
245+
4. Use AI to automatically generate a **Commit Message**, or enter your own message to describe what has changed.
246+
5. Click the **Push** icon to commit and push the update to your connected repository.
247+
248+
<div style={{
249+
position: 'relative',
250+
paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
251+
height: 0,
252+
width: '100%'}}>
253+
<iframe
254+
src="https://demo.arcade.software/ip4kqyERAlghfxmFhV6c?embed&show_copy_link=true"
255+
title=""
256+
style={{
257+
position: 'absolute',
258+
top: 0,
259+
left: 0,
260+
width: '100%',
261+
height: '100%',
262+
colorScheme: 'light'
263+
}}
264+
frameborder="0"
265+
loading="lazy"
266+
webkitAllowFullScreen
267+
mozAllowFullScreen
268+
allowFullScreen
269+
allow="clipboard-write">
270+
</iframe>
271+
</div>
272+
<p></p>
273+
274+
275+
### Revert Changes
276+
277+
If you want to undo changes before pushing them, you can revert individual files or all changes at once.
278+
279+
- To revert a specific file, **right-click** on it and select **Discard Changes**.
280+
- To discard all pending changes, click the **discard icon** on the right side of the Source Control panel.
281+
282+
![revert-change.avif](imgs/revert-change.avif)
283+
284+
### Pull Changes
285+
286+
To update your project with the latest code from the remote repository, click the **pull icon** in the Source Control panel. Dreamflow will fetch and merge any new commits from your remote branch.
287+
288+
![pull-changes.avif](imgs/pull-changes.avif)
289+
290+
### Resolve Conflicts
291+
292+
When you have conflicts, files are marked with a red **!** icon in the **Changes** list. To resolve conflict:
293+
1. Open the file and review the differences.
294+
2. You’ll see both versions side by side:
295+
- Incoming changes from remote (from the repository)
296+
- Your existing changes (your local edits)
297+
3. Choose whether to **Accept Existing, Accept Incoming, Accept Both**, or resolve the conflict manually.
298+
4. Once resolved, save the file, commit and push again to sync your changes.
299+
300+
<div style={{
301+
position: 'relative',
302+
paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
303+
height: 0,
304+
width: '100%'}}>
305+
<iframe
306+
src="https://demo.arcade.software/jjWKhiY2J0OmYna7rX3G?embed&show_copy_link=true"
307+
title=""
308+
style={{
309+
position: 'absolute',
310+
top: 0,
311+
left: 0,
312+
width: '100%',
313+
height: '100%',
314+
colorScheme: 'light'
315+
}}
316+
frameborder="0"
317+
loading="lazy"
318+
webkitAllowFullScreen
319+
mozAllowFullScreen
320+
allowFullScreen
321+
allow="clipboard-write">
322+
</iframe>
323+
</div>
324+
<p></p>
325+
326+
### Disconnect Repository
327+
328+
If you want to unlink your project from a connected Git repository:
329+
330+
1. Open the **Source Control panel**.
331+
2. Click the **disconnect icon** on the right side.
332+
3. Confirm the action when prompted.
333+
334+
Once disconnected, your project will no longer sync changes with the remote repository. Since you cannot connect a non-blank Git repo to an existing Dreamflow project, you will need to [clone your repository](#clone-codebase) into a new project if you would like to reconnect it to Dreamflow.
335+
336+
337+
338+
![disconnect-repo.avif](imgs/disconnect-repo.avif)
339+
23.4 KB
Binary file not shown.
23.4 KB
Binary file not shown.
23.4 KB
Binary file not shown.
58.7 KB
Binary file not shown.
37.9 KB
Binary file not shown.
28.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)