Skip to content

Commit a77c041

Browse files
committed
Adding merge v2 info
1 parent ed54a9a commit a77c041

File tree

1 file changed

+126
-1
lines changed
  • docs/testing-deployment-publishing/branching-collaboration

1 file changed

+126
-1
lines changed

docs/testing-deployment-publishing/branching-collaboration/branching.md

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description: Learn how branching in FlutterFlow allows you to add new features w
55
tags: [Branching, Collaboration]
66
sidebar_position: 1
77
keywords: [Branching, Collaboration, FlutterFlow, Concepts]
8+
toc_max_heading_level: 4
89
---
910

1011
# Branching
@@ -185,8 +186,22 @@ During a merge, FlutterFlow compares the changes made in both branches, if the c
185186

186187
### Initiating a merge
187188

188-
You can initiate a merge in either direction by selecting the **Branch Options** button next to the current branch in the **Branching Menu.**
189+
FlutterFlow currently supports **two merging approaches**: the existing “**Merge**” functionality and the new “**Git Merge**” (v2). Below is a comprehensive overview of both approaches and detailed guidance on the recommended workflow.
189190

191+
- [**Merge (Legacy)**](#): The legacy merge uses a custom tool (originally built in FlutterFlow) to calculate differences and conflicts between branches.
192+
- [**Git Merge (New)**](#): The new Git Merge option leverages Git's robust repository and conflict-resolution capabilities.
193+
194+
:::warning
195+
196+
At present, both methods are available side by side, allowing you to either continue using the legacy merge or adopt Git Merge. Over time, as Git Merge proves its stability, the legacy merge may be deprecated.
197+
198+
The Merge (Legacy) option has some known issues with merges being incorrectly calculated. Therefore, **we strongly recommend using [Git Merge](#) whenever possible for a smoother and more accurate merge process.**
199+
200+
:::
201+
202+
#### Merge (Legacy)
203+
204+
You can initiate a merge in either direction—merging from a parent branch into a child branch or from a child branch back into the parent branch—by selecting the Branch Options button next to the current branch in the Branching Menu.
190205

191206
<div style={{
192207
position: 'relative',
@@ -220,6 +235,95 @@ Next, you'll see a screen that will display if there are any conflicts. If you d
220235

221236
![merge](../imgs/merge.avif)
222237

238+
#### Git Merge (New)
239+
240+
The new Git Merge option uses Git under the hood to calculate differences between project files. Each project is backed by a repository of YAML files (except for custom code, which appears as Dart files). These YAML files map directly to various project properties, and Git calculates differences among these files to identify merge conflicts. This method provides clearer and more consistent conflict detection compared to [legacy Merge](https://www.notion.so/Merge-V2-16fc6675fc3180bb9ad5c7ac2e3dbd06?pvs=21) (a custom solution).
241+
242+
:::info
243+
244+
This option is currently in **beta**. In addition to fixing any issues, here’s what we have planned:
245+
246+
- **Hover-Based Documentation**: Display helpful tooltips for YAML fields (scheduled before production release).
247+
- **Inline YAML Errors**: Show errors directly in the file for quicker fixes (scheduled before production release).
248+
- **Simplified YAML**: Make YAML files and errors more user-friendly and understandable.
249+
- **Enhanced Visual Diff Tools**: Provide more intuitive views for comparing changes.
250+
- **User Experience Improvements**: Continuously refine merging workflows and UI elements.
251+
- **Performance Optimizations**: Improve speed when initiating merges.
252+
253+
:::
254+
255+
[how to initiate merge with this option; just like previous one]
256+
257+
When performing a Git merge in FlutterFlow, you’ll see a screen with multiple panels and info sections. Here are the details of it.
258+
259+
[image]
260+
261+
**Top Panel**
262+
263+
- **Branch Information**: At the top of the merge interface, you’ll see exactly which branches are being merged. You have two options for merging directions:
264+
- **Parent → Child**: Pulls changes down from the parent into the child branch, often used to keep a feature branch in sync with upstream updates.
265+
- **Child → Parent**: Pushes features (or other changes) from the child branch back up to the parent, commonly done once a feature is ready for the main codebase.
266+
- **YAML Validation Errors**: Occurs when manual edits to the YAML files produce invalid syntax. Clicking on these errors should redirect you to the specific file, and invalid lines will be underlined in red within the file. Note that, you **cannot** complete the merge while YAML errors exist.
267+
- **Project Errors**: Project errors occur when the result of a merge creates a problem in your project. For example, this might happen if the merge results in two data types having the same name. These errors need to be resolved to ensure your project works as expected. You have several options to deal with project errors:
268+
- **Fix the Errors During the Merge**: This approach ensures that the merged project is error-free right from the start. Here’s how you can do it:
269+
- **Edit the YAML files:** Update the YAML files to fix issues, such as renaming a data type that causes a conflict.
270+
- **Edit the project directly while merging:** While still in the merge process, open the project, make the necessary changes (like renaming the conflicting data type), and then continue.
271+
- **Fix the Errors After the Merge**: If you prefer, you can complete the merge first and address the errors later. For example, finish the merge process as it is. After merging, go back to the project and resolve any issues.
272+
- **Cancel**: Abandons the merge process and discards any conflict resolutions you’ve already applied during this merge session.
273+
- **Merge**: Finalizes the merge once all merge conflicts and YAML validation errors are cleared. Project errors can remain if you choose to resolve them later.
274+
- **Bulk Accept Changes**: Accessible via the arrow next to “Merge,” this option lets you accept all changes from one branch at once—handy if you already know which branch’s changes take precedence.
275+
276+
**Left-Hand Side Panel: Project Configuration YAML Files**
277+
278+
The left-hand side panel displays all the project configuration YAML files, which are crucial for managing your project’s settings and structure.
279+
280+
YAML (Yet Another Markup Language) files use a simple, human-readable format to define configuration data. They are [particularly useful](https://www.notion.so/Merge-V2-16fc6675fc3180bb9ad5c7ac2e3dbd06?pvs=21) during a merge because they allow you to directly review, understand, and resolve any changes or conflicts in your project’s configuration.
281+
282+
- **Filter Files:** You can use filters to narrow down the list of YAML files based on specific criteria:
283+
- **All Files:** Shows every YAML file in the project.
284+
- **Files with Changes:** Displays only files where a change has been made on either branch.
285+
- **Files with Conflicts:** Shows only files that have merge conflicts, where the changes in one branch directly contradict the changes in the other.
286+
287+
288+
:::tip
289+
- A **change** refers to any update, addition, or deletion made to a YAML file on one of the branches. For example, modifying a field name or changing the properties of a widget.
290+
- A **conflict** occurs when the same part of a file has been changed in both branches, making it unclear which version to keep. For instance, if one branch changes the color of the Container to blue and the other changes it to red, this creates a conflict.
291+
292+
:::
293+
294+
- **Search for a Specific File:** If you’re looking for a particular YAML file, you can use the search bar to locate it quickly. This is especially useful in larger projects with many configuration files.
295+
296+
:::info
297+
298+
- Some YAML file names may include a **key**, which serves as a unique identifier.
299+
- Clicking on a YAML file in the panel opens it in the editor, allowing you to view, edit, and resolve issues directly.
300+
301+
:::
302+
303+
304+
**Lower Panel: The Merge Result**
305+
306+
The **Lower Panel** displays the final merged files after Git applies its merging logic. It gives you a chance to manually inspect and edit the outcome—whether or not a conflict occurs.
307+
308+
Git attempts to combine changes from both branches automatically. If Git can’t reconcile certain lines, it flags a **merge conflict** in the file. Conflicts appear with special markers like `<<<<<<< HEAD`, `=======`, and `>>>>>>>`.
309+
310+
- `<<<<<<< HEAD`: Marks the beginning of your current branch’s changes.
311+
- `=======`: Separates your current branch’s changes from the other branch’s changes.
312+
- `>>>>>>> <other-branch>`: Marks the end of the conflict, indicating the other branch’s changes.
313+
314+
:::info
315+
316+
Git may label branches as `HEAD` or a commit reference, which can differ from the friendly branch names shown in FlutterFlow.
317+
318+
- **HEAD**: Refers to the current branch (or commit) you’re on—essentially your “main viewpoint” in Git.
319+
- **Other Branch**: Denotes the second branch (or commit) you’re merging in, which might be labeled using a commit hash or the branch name from the repository.
320+
321+
:::
322+
323+
You can modify files in the lower panel at any time—even if there’s no conflict. You could also choose which branch’s changes to keep here. You might decide to keep certain lines from `HEAD` (your current branch) or from the other branch or combine them manually.
324+
325+
After editing, click Save to confirm your changes. A red Reset button appears if you want to undo your edits and restore the file to its initial merged state before you began editing.
326+
223327
### Resolve merge conflicts
224328
A merge conflict occurs when multiple team members make changes to the same part of the project.
225329

@@ -236,6 +340,8 @@ When Alice's changes are merged into the main project first, her updates will be
236340

237341
In your project, if you get merge conflicts, here’s how you resolve them.
238342

343+
#### Merge (Legacy)
344+
239345
<div style={{
240346
position: 'relative',
241347
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
@@ -267,6 +373,25 @@ For certain conflicts, such as those involving variables and API configurations,
267373

268374
![view-configuration](../imgs/view-configuration.avif)
269375

376+
#### Git Merge (New)
377+
When you initiate a merge using Git, the system attempts to automatically reconcile your project files. Any conflicts that cannot be automatically resolved are flagged for your attention.
378+
379+
You can review each file with merge conflicts and choose to:
380+
381+
- Accept all changes from one branch.
382+
- Pick specific changes from each branch.
383+
- Manually edit the merged YAML files.
384+
385+
After conflict resolution, it’s essential to correct any YAML validation errors that arise from manual edits.
386+
387+
Finally, complete the merge by clicking “Merge.” If you merged a child branch into its parent and are confident everything looks correct, you may delete the child branch.
388+
389+
:::tip
390+
Should you discover a mistake in your merge, you can revert your branch to a prior commit, though any work done since that commit will be lost.
391+
:::
392+
393+
[Arcade]
394+
270395
### Resolve conflicts manually
271396
If you choose to resolve manually, you can directly make changes in the **Accepted Changes** section. Note that if you cancel a manual resolution, you can choose to either keep or discard the changes you have made since starting the manual resolution.
272397

0 commit comments

Comments
 (0)