In this section: |
How to: |
You can apply source control management to files and folders in your WebFOCUS repository, enabling multiple users to make updates simultaneously without conflicts. When you apply the source control feature to a workspace and connect to a source control repository, such as GitHub, you can store, synch, and safely backup all changes made to your content.
Before you begin using source control management from the WebFOCUS repository, you must enable the option in the Administration Console. For more information, please see the WebFOCUS Security and Administration technical content.
Source Control is a feature that provides many benefits to developers, including the following:
The Enable Source Control dialog box opens.
The following image shows an example of the Enable Source Control dialog box populated with the GitHub repository information.
The workspace title in the Resources tree changes to show the branch that is currently enabled in the remote repository, as shown in the following image.
The items in the workspace show the Un-tracked label, as shown in the following image, indicating that the source control management is enabled but the content is not yet synchronized with the remote repository.
All subsequent changes to this workspace can no longer be committed to the remote repository.
As a best practice, work with a secondary branch before returning all content and changes to the master branch.
You are redirected to your remote repository.
In this example, we are creating a new branch in the GitHub remote repository, as shown in the following image.
The Switch To dialog box opens, as shown in the following image. Here you can see all the branches that are associated with your Source Control repository.
Note: If your list is long, you can use the search field to look for a specific branch.
The name of your new remote branch is now showing next to the name of the workspace in the Resources tree, as shown in the following image.
The Commit dialog box opens.
The items are now synced with your remote repository, as shown in the following image.
The item now shows the Modified label, as shown in the following image.
Notice that only the updated item is displayed in the Unstaged pane of the Commit dialog box, as shown in the following image.
Once all your changes are final, you can bring your content to the master branch.
You are redirected to the remote repository, where you are prompted to create a pull request. The following image shows an example of the pull request in the GitHub remote repository.
A confirmation displays informing you that the merge was successful, as shown in the following image.
You successfully added your workspace and its content to Source Control.
Note: When several users work on the same files and commit their changes to the same remote repository, use the Commit to WebFOCUS option to sync all committed changes to your environment. If there are uncommitted changes, a warning displays when you click Commit to WebFOCUS.
You can view and compare different versions of an item at the moments it was committed to the remote repository.
The History dialog box opens, as shown in the following image.
Here you can see the basic information about the commits this item underwent, including the committing user, commit times and messages, and the environment from which the commits were made.
The Git Revision Difference session opens in the new browser window, displaying both versions of the source code for this item side by side, as shown in the following image.
The older version is displayed on the left, the newer one is shown on the right. The lines that were added are highlighted in green, the lines that were removed are highlighted in red.
Note: Only two versions can be selected at one time. If you select two versions that are separated from each other by other commits, the Git Revision Difference session will display all changes that took place between the versions you selected.
In this section: |
How to: |
The Command Editor is designed to execute individual GIT commands in a simple and intuitive tool. This capability allows you to perform GIT commands on workspaces as well as individual items. It is also useful for resolving errors that require executing GIT commands that the basic Source Control Management interface does not provide.
Note: To use the Command Editor on a workspace level, right-click the workspace that was placed under source control, point to Git / Source Control, and then click Command Editor.
The Command Editor dialog box opens.
The Status command options and the item path will display.
The status of the item displays in the upper pane of the Command Editor. This item happens to be recently modified, which is reflected in the status entry, as shown in the following image.
If you are unsure which options to choose, hover your cursor over an option checkbox and view the tooltip, as shown in the following image.
In this example we selected message and Push after Commit, as shown in the following image.
The item is committed to the remote repository.
Your commit is successful.
When you open the Command Editor for a workspace or an item, different sets of commands display, depending on the level.
The following commands are available in the Command Editor:
Note: The repository you cloned is still connected to the remote version so that you can push your local changes to the remote repository to keep them synced when you are online.
Note: If there are no conflicting changes, merge can be done as a pull request through the web interface of your repository provider. Alternatively, it can be done via command line.
To learn more about GIT commands and their options, consult the GIT documentation from your remote repository provider.