Make Your Changes Public

When you edit files in your workspace, you're working within your local repository, which means that only you can see them. To share your private changes with your team, you'll need to push them to a shared project repository (the remote repo).

When you make changes in your workspace, an yellow dot appears next to the branch name in the header to let you know that you have uncommitted changes:
Description of git-header-badge.png follows
Description of the illustration git-header-badge.png

Saving your changes to a remote repo is a two-step process: commit and push.
  1. The first step you must perform is a commit. When you make a commit, you're basically grouping together the files in your local branch that you eventually want to move to the remote branch. You also provide a description of the changes you're making in the commit, which can be very helpful later if you need to track down which files were changed.

    For example, suppose you added a new dynamic layout to include a field. When you committed the changes, you added a commit message describing the update, "Added new layout X for field Y". You then added a rule for the new layout, using the commit message "Added rule Z for layout X". By reviewing the history for the repository (using the Git History tab at the bottom of the Designer), you can easily see what files were changed and the reasons for changing them:Description of githistory.png follows
    Description of the illustration githistory.png

  2. The second step is push, which synchronizes all the files you have committed thus far (since the last push) with the remote branch. If you have edited some files but haven't committed them, you'll be prompted to commit before you can push.

Note:

You can use the Publish action in the header if you want to commit, push, and merge the remote branch into the main branch in one operation. See Deploy a Visual Application. Don't use Publish if you're not ready to merge the remote branch into the main branch.

Commit Your Changes In the Local Branch

You use the Commit option to save changes that you've made in the local branch of your workspace. A commit takes a snapshot of your workspace, so you always have a "safe" version of your changes at that point in time.

Ideally, commit your changes as often as you can. You'll be prompted to commit changes in your local branch when you try to pull commits from a remote branch, switch to a new branch in your workspace, rename a branch, share your changes, even upgrade your application.

To commit changes in your workspace:

  1. Click the Git menu in the header or the Options menu in the Git Panel.
  2. Select Commit to commit your changes.
    1. If you're not ready to commit some of your changes, scroll through the Items to Commit and deselect the files you don't want to commit.
    2. Enter a commit message to describe the changes you've made in the remaining files. This value is required to proceed.
    3. Click Commit.

    When the commit is successful, close the confirmation message that appears.

Push Your Changes to the Remote Branch

Use the Push option to move changes you've committed from the local branch in your workspace to the remote branch, thus making your changes visible to team members. You'll need to explicitly commit your changes before you can push them to a remote branch.

Note:

Before you commit and push your changes, you should update the source files in your workspace by pulling the most recent versions from the repository. If the file versions in the remote branch are newer than the versions in your workspace, you’ll see a status message when attempting to push your changes that the push was rejected and that you should pull the most recent versions from the repository.

To push your commits from the local branch in your workspace to the remote branch:

  1. Click the Git menu in the header or the Options menu in the Git Panel.
  2. Select Push.

    If there are no changes to push, click Close. Otherwise:

    • To push committed changes to the remote branch, click Push Changes.
    • To commit all uncommitted changes, enter a commit message and click Commit All and Push. If you don’t want to commit uncommitted changes but do want to push previously committed changes to the remote branch, clear the Commit changes before pushing check box.

    When the push is successful, close the confirmation message that appears.