Synchronizing Feature and Source Branches
Working with branches is a good practice to avoid working directly with the main or any other source branch. A feature branch isolates your work from the source branch and is supposed to be short-lived. However, while working on a feature branch, often you need to get the latest changes from the source to this feature branch.
There is more than one way to refresh your feature branch with the latest changes, but it all depends on the tools you use. Here's a typical process:
- Check out the source branch (
git checkout
). - Update the local source branch with the latest changes from the remote branch (
git pull
). - Check out your feature branch (
git checkout
). - To update your feature branch with the latest changes you just fetched, either:
- Merge the changes from the source branch into your branch (
git merge
). - Rebase the source branch into your branch (
git rebase
).
- Merge the changes from the source branch into your branch (
Once both branches are updated and the feature branch changes are also ready, you can create a merge request to merge your feature branch into the remote source branch.
You may still get merge conflicts during the process, there you need to resolve the conflicts manually and decide which changes to keep and which changes to remove. For more information, see Resolving Merge Conflicts in DataOps.
For known limitations when you work in the web interface, see Resolving Merge Conflicts in Merge Requests.