Many development projects involve creating branches (or "forks") for a feature, release, or other development milestone. A branch is essentially a copy of the code base that shares its history. Reincorporating the changes from a branch is known as merging.
Development projects typically have:
For more information about the concepts behind branching and merging, see:
For a general introduction to source control concepts, we recommend Version Control by Example (free PDF) by SourceGear founder Eric Sink. |
You can work with branches in Source Control for Oracle, but you can't create or merge branches. To branch with Source Control for Oracle, you need to create the branch using your source control system.
Link to the appropriate branch in a Source Control for Oracle project. Then choose one of the two approaches below:
In this approach, you continue working on the same schema, but link it to the branch in your source control system.
Once the branch is created, remove the source control project from Source Control for Oracle, then link the schema again in a new Source Control for Oracle project. In step 2 of the new source control project wizard, specify the location of the branch in source control.
In this approach, you create the branch in your source control system, then create a new schema to link with it.
Create a new empty schema, and link it to source control in a Source Control for Oracle project. When you link, specify the location of the branch in source control, then on the Get latest tab, update the schema with the latest version from source control.
Switch between branches using the drop-down menu in the top right of the Source Control for Oracle window:
Source Control for Oracle doesn't provide automatic or line-by-line merging. You can use Source Control for Oracle or Schema Compare for Oracle to merge at an object level, but not choose line-by-line changes.
When you merge with Source Control for Oracle or Schema Compare for Oracle, you choose a version of each object to keep. For example, you might keep the trunk version of a table and the branch version of a view.
There are three approaches to merging:
You can manually merge the branch changes back into the trunk using your source control system as you would for application code.
We recommend this approach if the merge is complex, or if there are conflicts; for example, if the same object has been modified in both the branch and the trunk.
When merging manually, make sure referential integrity is maintained or the database may be left in an invalid state. Your source control system may include auto-merging functionality that simplifies manual line-by-line merges. |
This method of merging is not yet possible with Git. |
If you don't need to do a line-by-line merge, you can merge with Source Control for Oracle.
To do this:
The trunk is updated with the branch changes.
If there are no conflicting changes between the branch and the trunk, you can merge automatically using Schema Compare for Oracle.
To merge branch changes into the trunk with Schema Compare for Oracle:
In Schema Compare for Oracle, create a new project. Set the local copy of the branch as the source, and the trunk database as the target.
For more information, see Setting data sources. |
Schema Compare shows the differences between the branch and the trunk.