Committing Source Control Files—Git

When you are finished editing files, you can commit them to source control. Committing a file adds your changes to the local Git database. It is a good idea to periodically commit files so that they are organized in logical chunks with a comment that accurately summarizes the changes. When you are ready to add your local commits to the remote repository, you can push these files to the remote. Committing and pushing changes frequently can help to avoid conflicting changes from other users, although conflicts are bound to occur from time to time.

How to Commit Files to Source Control

  1. Do one of the following, depending on the part of the user interface you are using:
    • Status Bar In the lower-right of Flare, click (a number indicates how many files have changes that need to be committed).

      Note If you do not see this option, make sure View > Status Bar is enabled.

    • Pending Changes Window Pane From the Source Control ribbon, open the Pending Changes window pane. Select the files in the window pane that you want to commit, and in the local toolbar click Commit button.
    • Ribbon Select Source Control > Commit (for selected files) or Source Control > Commit All (for all files in the project).
    • Right-Click If you have the Content Explorer, Project Organizer, Pending Changes window pane, or File List open, right-click the file you want to commit and select Source Control > Commit (for selected files) or Source Control > Project > Commit All (for all files in the project).
  2. Enter a comment tied to the commit. This enables you to keep an audit trail for a file. The comment can then be viewed from the History dialog, which can be accessed from the Source Control Explorer, the Source Control ribbon, the File menu, or the Source Control button Source Control drop-down button.
  3. Click Commit.

How to Commit Files to Source Control Using the Explorer

  1. Select View > Source Control Explorer. The Source Control Explorer opens.
  2. From the drop-down or the Home pane, select Pending Changes.

    The Pending Changes pane opens. Files that will be committed are listed under Included Changes, and files that will not be committed are listed under Excluded Changes. You can identify edited files because [modified] is displayed next to the file name.

  3. In the Comment field, enter a comment tied to the commit. This enables you to keep an audit trail for a file. The comment can then be viewed from the History dialog, which can be accessed from the Source Control Explorer, the Source Control ribbon, the File menu, or the Source Control button Source Control drop-down button.
  4. (Optional) If you want to select the files or folders that you include in the commit, right-click a file or folder and select one of the following options from the context menu.

    • Exclude Excludes the selected file from the commit

    • Exclude Unselected Excludes all unselected files from the commit

    • Include Includes the selected file in the commit

    • Include Unselected Includes all unselected files in the commit

  5. Click Commit Included to commit all of the files in the Included Changes list.