> For the complete documentation index, see [llms.txt](https://doc.sysdevmobile.com/kalipso/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.sysdevmobile.com/kalipso/documentation/git/branches.md).

# Branches

Branches allow you to develop features, fix bugs, or experiment with new ideas in an isolated environment without affecting the main codebase. Kalipso Git integration provides easy branch management directly from the ribbon.

<figure><img src="https://1614058754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ5vDGuBZwhJDeu5Rq7Wt%2Fuploads%2Fgit-blob-18b08d9680c1747f05284d52b88e42199b762a34%2Fgit_branches_menu.png?alt=media" alt="Branches dropdown menu"><figcaption><p>Branches menu</p></figcaption></figure>

## Branches Menu

Click **Branches** in the Git ribbon to access branch operations:

* **Current Branch** - The currently active branch is marked with a checkmark (e.g., `master`). Click on any branch name to switch to that branch.
* **Refresh** - Updates the list of branches from the repository, including any new remote branches.
* **Add Branch** - Creates a new branch based on the current branch.

## Working with Branches

### Switch Branch

To switch to a different branch, click **Branches** and select the branch name from the list. The checkmark indicates which branch is currently active.

{% hint style="warning" %}
Before switching branches, Kalipso will prompt to to commit if there is any uncommitted changes to avoid losing your work.
{% endhint %}

### Create a New Branch

<figure><img src="https://1614058754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ5vDGuBZwhJDeu5Rq7Wt%2Fuploads%2Fgit-blob-6af18f26e0df66b5a06a956fce9219f0c7c8a2f5%2Fgit_add_branch.png?alt=media" alt="Add Branch dialog"><figcaption><p>Add Branch dialog</p></figcaption></figure>

1. Click **Branches** in the Git ribbon
2. Click **Add Branch**
3. Enter a name for the new branch
4. The new branch will be created based on your current branch

{% hint style="info" %}
Use descriptive branch names that indicate the purpose of the branch, such as `new_login` or `form_sync`.
{% endhint %}

### Merge Branches

To merge changes from one branch into another:

1. Switch to the branch you want to merge changes **into** (the target branch)
2. Click **Merge** in the Git ribbon
3. Select the branch you want to merge changes **from** (the source branch)
4. Resolve any conflicts if they occur
5. Commit the merge result

### Resolving Conflicts

When merging branches, conflicts may occur if the same elements were modified differently in each branch. The Merge Branch window helps you resolve these conflicts:

<figure><img src="https://1614058754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ5vDGuBZwhJDeu5Rq7Wt%2Fuploads%2Fgit-blob-a2714555f01d4e956bce0ddc4308a202e89e7f32%2Fgit_merge_conflicts.png?alt=media" alt="Merge Branch conflict resolution"><figcaption><p>Merge Branch - Conflict Resolution</p></figcaption></figure>

The Merge Branch window displays:

* **Conflicts counter** - Shows the number of conflicts detected (e.g., "Conflicts: 1/1")
* **Keep Incoming** - Accepts all changes from the source branch (the branch being merged in)
* **Keep Target** - Keeps all changes from the target branch (your current branch)

#### Display Filter

* **All Modified** - Shows all files that were modified in either branch
* **Conflicts Only** - Shows only the files with conflicts that need resolution

#### Conflict Tree

The tree view displays the project structure with conflicting items marked with a warning icon. Each conflict shows:

* **Item name** - The form, control, or file with the conflict
* **Conflict description** - Explains the nature of the conflict (e.g., "Deleted in source and modified in target")
* **Resolution buttons** - For each item, choose to **Delete** or **Keep Target**

#### Resolving Individual Conflicts

For each conflicting item, you can:

* **Delete** - Remove the item (accept the deletion from the source branch)
* **Keep Target** - Keep the version from your current branch

After resolving all conflicts, click **Merge** to complete the operation, or **Cancel** to abort the merge.

{% hint style="info" %}
Review each conflict carefully before choosing a resolution. Consider which version of the element contains the changes you want to keep.
{% endhint %}
