|
| 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 | +:::warning |
| 15 | + |
| 16 | +Currently, it 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. |
| 17 | + |
| 18 | +For team collaboration, please contact the **Enterprise team**. |
| 19 | + |
| 20 | +::: |
| 21 | + |
| 22 | +## Connect Repository |
| 23 | + |
| 24 | +You can connect a repository in two main ways: |
| 25 | + |
| 26 | +- **Clone Codebase**: Use this option when you want to start a new project in Dreamflow using an existing Git repository. |
| 27 | + |
| 28 | +- **Connect Project to Git**: Use this option when you already have a project built inside Dreamflow and want to link it to a Git repository. |
| 29 | + |
| 30 | +### Clone Codebase |
| 31 | + |
| 32 | +To clone a codebase: |
| 33 | + |
| 34 | +1. Go to the [**Dreamflow Dashboard**](https://app.dreamflow.com/dashboard) and select **Clone Codebase**. |
| 35 | +2. In the dialog box, enter the following details: |
| 36 | + - **Project Name** – Choose a name for your Dreamflow project. |
| 37 | + - **Repository URL** – Paste the HTTPS URL of your Git repository (e.g., `https://github.com/username/repo.git`). |
| 38 | + - **Access Token** – Enter your personal access token. Refer to the [**Get Access Token**](#get-access-token) for more information on how to generate one. |
| 39 | +3. Once all fields are filled in, click **Clone Repository**. |
| 40 | + |
| 41 | +Dreamflow will then clone the repository, import your Flutter project files, and automatically open it in your workspace for editing. |
| 42 | + |
| 43 | +Here’s an example of cloning a repository from GitHub: |
| 44 | + |
| 45 | +<div style={{ |
| 46 | + position: 'relative', |
| 47 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 48 | + height: 0, |
| 49 | + width: '100%'}}> |
| 50 | + <iframe |
| 51 | + src="https://demo.arcade.software/kUa2NnyUeTHlPsjdfl3B?embed&show_copy_link=true" |
| 52 | + title="" |
| 53 | + style={{ |
| 54 | + position: 'absolute', |
| 55 | + top: 0, |
| 56 | + left: 0, |
| 57 | + width: '100%', |
| 58 | + height: '100%', |
| 59 | + colorScheme: 'light' |
| 60 | + }} |
| 61 | + frameborder="0" |
| 62 | + loading="lazy" |
| 63 | + webkitAllowFullScreen |
| 64 | + mozAllowFullScreen |
| 65 | + allowFullScreen |
| 66 | + allow="clipboard-write"> |
| 67 | + </iframe> |
| 68 | +</div> |
| 69 | +<p></p> |
| 70 | + |
| 71 | +:::warning |
| 72 | + |
| 73 | +Dreamflow currently supports **Flutter repositories only**. If your repository contains non-Flutter code or multiple projects (like a monorepo), the import may fail. |
| 74 | + |
| 75 | +Support for monorepos is planned for a future update. |
| 76 | + |
| 77 | +::: |
| 78 | + |
| 79 | +### Connect Project to Git |
| 80 | + |
| 81 | +To connect a Dreamflow project to Git repo: |
| 82 | + |
| 83 | +1. Open your existing project in Dreamflow. Go to the **Source Control Panel** on the left sidebar and click **Connect Repository**. |
| 84 | +2. In the dialog, provide: |
| 85 | + 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. |
| 86 | + 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. |
| 87 | +3. Click **Connect**. |
| 88 | + |
| 89 | +Once connected, Dreamflow will automatically start tracking file changes, which you can view in the **Changes** list. |
| 90 | + |
| 91 | +:::warning |
| 92 | + |
| 93 | +The repository must be blank or contain only a README and/or LICENSE file. |
| 94 | + |
| 95 | +::: |
| 96 | + |
| 97 | +Here’s an example of connecting a project to a repository hosted on GitHub: |
| 98 | + |
| 99 | +<div style={{ |
| 100 | + position: 'relative', |
| 101 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 102 | + height: 0, |
| 103 | + width: '100%'}}> |
| 104 | + <iframe |
| 105 | + src="https://demo.arcade.software/sVeZ20PpJwRrMpUwTJ6I?embed&show_copy_link=true" |
| 106 | + title="" |
| 107 | + style={{ |
| 108 | + position: 'absolute', |
| 109 | + top: 0, |
| 110 | + left: 0, |
| 111 | + width: '100%', |
| 112 | + height: '100%', |
| 113 | + colorScheme: 'light' |
| 114 | + }} |
| 115 | + frameborder="0" |
| 116 | + loading="lazy" |
| 117 | + webkitAllowFullScreen |
| 118 | + mozAllowFullScreen |
| 119 | + allowFullScreen |
| 120 | + allow="clipboard-write"> |
| 121 | + </iframe> |
| 122 | +</div> |
| 123 | +<p></p> |
| 124 | + |
| 125 | +### Get Access Token |
| 126 | + |
| 127 | +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. |
| 128 | + |
| 129 | +#### For GitHub |
| 130 | + |
| 131 | +Follow these official GitHub guides to create a Personal Access Token: |
| 132 | + |
| 133 | +- [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) |
| 134 | +- [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) |
| 135 | +- [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) |
| 136 | + |
| 137 | +**Required Scopes for Dreamflow:** |
| 138 | + |
| 139 | +- For **Fine-grained tokens:** Grant **Content: Read & Write** access to the specific repository you plan to use. |
| 140 | +- For **Classic tokens:** Enable **repo** and **workflow** permissions. |
| 141 | + |
| 142 | +#### For GitLab |
| 143 | + |
| 144 | +You can generate a Personal Access Token directly from your GitLab account by following the official documentation: |
| 145 | + |
| 146 | +- [GitLab: Create a personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) |
| 147 | + |
| 148 | +**Required Scopes for Dreamflow:** |
| 149 | + |
| 150 | +- `api`: Full API access. |
| 151 | +- `read_repository` and `write_repository` to read and write code to your repository. |
| 152 | + |
| 153 | +Once your token is created, copy it and paste it into the **Access Token** field when connecting your repository in Dreamflow. |
| 154 | + |
| 155 | +## Git Operations |
| 156 | + |
| 157 | +This section walks you through how to perform common Git operations like branching, committing, and syncing your code. |
| 158 | + |
| 159 | +### Branching |
| 160 | + |
| 161 | +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. |
| 162 | + |
| 163 | +#### Create a New Branch |
| 164 | + |
| 165 | +You can create a new branch to work on a specific feature or fix without affecting the `main` branch. |
| 166 | + |
| 167 | +To create a new branch: |
| 168 | + |
| 169 | +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`). |
| 170 | +2. Click the **+** button on the right side of the panel. |
| 171 | +3. In the dialog, enter a name for your new branch (for example, `feature/user-profile`). |
| 172 | +4. Click **Save**. |
| 173 | + |
| 174 | +Once created, Dreamflow will automatically switch your workspace to the new branch. |
| 175 | + |
| 176 | +<div style={{ |
| 177 | + position: 'relative', |
| 178 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 179 | + height: 0, |
| 180 | + width: '100%'}}> |
| 181 | + <iframe |
| 182 | + src="https://demo.arcade.software/EJWEpo1PSAo6xE5ow1e0?embed&show_copy_link=true" |
| 183 | + title="" |
| 184 | + style={{ |
| 185 | + position: 'absolute', |
| 186 | + top: 0, |
| 187 | + left: 0, |
| 188 | + width: '100%', |
| 189 | + height: '100%', |
| 190 | + colorScheme: 'light' |
| 191 | + }} |
| 192 | + frameborder="0" |
| 193 | + loading="lazy" |
| 194 | + webkitAllowFullScreen |
| 195 | + mozAllowFullScreen |
| 196 | + allowFullScreen |
| 197 | + allow="clipboard-write"> |
| 198 | + </iframe> |
| 199 | +</div> |
| 200 | +<p></p> |
| 201 | + |
| 202 | +#### View and Switch Branches |
| 203 | + |
| 204 | +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. |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | +#### Refresh Branch List |
| 209 | + |
| 210 | +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. |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | +### Push Changes |
| 215 | + |
| 216 | +To push changes from your project to the remote repository: |
| 217 | + |
| 218 | +1. Make edits to your app. |
| 219 | +2. Check **Source Control > Changes**. The modified file will be tagged **M** and listed there. |
| 220 | +3. (Optional) Click **View Diff** to compare your edit with the previous version. |
| 221 | +4. Enter a short **commit message** (e.g., “Change welcome message”). |
| 222 | +5. Click the **Push** icon to commit and push the update to your connected repository. |
| 223 | + |
| 224 | +<div style={{ |
| 225 | + position: 'relative', |
| 226 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 227 | + height: 0, |
| 228 | + width: '100%'}}> |
| 229 | + <iframe |
| 230 | + src="https://demo.arcade.software/ip4kqyERAlghfxmFhV6c?embed&show_copy_link=true" |
| 231 | + title="" |
| 232 | + style={{ |
| 233 | + position: 'absolute', |
| 234 | + top: 0, |
| 235 | + left: 0, |
| 236 | + width: '100%', |
| 237 | + height: '100%', |
| 238 | + colorScheme: 'light' |
| 239 | + }} |
| 240 | + frameborder="0" |
| 241 | + loading="lazy" |
| 242 | + webkitAllowFullScreen |
| 243 | + mozAllowFullScreen |
| 244 | + allowFullScreen |
| 245 | + allow="clipboard-write"> |
| 246 | + </iframe> |
| 247 | +</div> |
| 248 | +<p></p> |
| 249 | + |
| 250 | + |
| 251 | +### Revert Changes |
| 252 | + |
| 253 | +If you want to undo changes before pushing them, you can revert individual files or all changes at once. |
| 254 | + |
| 255 | +- To revert a specific file, **right-click** on it and select **Discard Changes**. |
| 256 | +- To discard all pending changes, click the **discard icon** on the right side of the Source Control panel. |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | +### Pull Changes |
| 261 | + |
| 262 | +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. |
| 263 | + |
| 264 | + |
| 265 | + |
0 commit comments