Branching, merging and tagging
Best Practices and tips for using Git with the Talend products.
Best practices for Git:
-
All developers should work on branches other than the main branch.
-
For each development (bug, new features), a feature branch is created. The developers work in local mode and ask for a review of their commits before merging their changes into the remote 'main' repository.
On a Talend Git remote project, local branches (Local Mode) are used by default. When developers work in local or offline mode on a Git project, they are working on the local branch associated with the branch they last worked on, and changes are automatically committed to the local Git repository.
Once the feature is ready, developer need to push the commits to the remote development branch before pulling and merging this remote branch to the 'main' when the feature is tested. In Git a remote branch is created on the whole repository and thus is available in all projects of this repository.
For more information on how to work with branches, see Working with project branches and tags.
-
Each time developers reach a Milestone (for releases, features, sprints, etc.), a Tag should be used. A new Tag should be created when the feature is ready for delivery (Production environment). If the tagged version needs bug fixing, a branch can be created from the Tag and the fix can then be included in the 'main'.
-
It is recommended to define patches as minor versions and full releases as major versions.
-
When working in a specific branch, it is recommended to filter the project on this branch using the Git Branches allowlist option in order to reduce the use of disk resources and improve performances.
Branching, merging, and tagging in Talend
From Talend Administration Center and Talend Studio, you can add branches and tags and switch between them.
- To create and edit branches and tags, you can:
-
use the Branch Management option on the Projects page of Talend Administration Center.
From Talend Administration Center, you can then create an execution task on a Job located in this specific branch or tag via the Job Conductor page.
- use the MetaServlet createBranch and createTag commands.
- select the New Branch and options in Repository Branch management menu of the Talend Studio Repository.
-
- To merge branches you need to:
- check out your remote branch B as a local branch with the same branch name in the Talend Studio Repository.
- update the local branch B using the remote branch A as the source to pull from, using the Pull And Merge Branch option from the drop-down menu.
- resolve any conflicts that occurred during the branch update.
- push your local branch B to the remote end.
For more information on Git merge operations, see Merging remote branches.