Adding Files to Source Control—Git

When working in a project that is connected to a source control application, there may be occasions when you have local files that are not yet part of the source control repository. For example, when you add a new topic, that file will not be included in the source control repository until you add it.

How to Add Files to Source Control

  1. Do one of the following, depending on the part of the user interface you are using:
    • Ribbon Select Source Control > Add.
    • 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 add and select Source Control > Add.

    The Commit dialog opens. The selected files are listed with check boxes next to them.

  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 .
  3. Click Commit.

How to Add 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 newly added files because [add] 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 .
  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. The Messages pane opens and displays a list of files that were committed.

    Note Adding files from other areas of the Flare interface (e.g., Pending Changes window pane, Source Control ribbon) will only add new files. However, if you use the Source Control Explorer to commit your files, it will commit all of your pending changes: both new files and modified files. If you do not want to include all of your files in the commit, you can right-click them and select Exclude. Files you exclude will not be committed.