Adding Files to a Git Repository in the MPLAB® X IDE

Last modified by Microchip on 2024/06/24 06:35

To start tracking a new file or to stage changes to an already tracked file in the Git repository, you need to add it to the repository.

Choose between these two workflows:

Workflow DescriptionExplicitly add new or modified files to the Index and then commit only those that are staged in the Index to the HEADSkip adding new or modified files to the Index and commit the required files directly to the HEAD
Workflow
Steps
1. In the Projects window, right-click the file you want to add.1. In the Projects window, right-click the file you want to commit.
2. In the context menu, choose Git>Add.This adds the file contents to the Index before you commit it.2. In the context menu, choose Git>Commit.
3. In the Projects window, right-click the file you want to commit.3. In the Commit dialog box, select the Select the Changes between HEAD and Working Tree ( Git HEAD WorkingTree ) toggle button. This displays the list of files that are not staged.
4. In the Commit dialog box, select the Changes between HEAD and Index ( Git HEAD Index ) toggle button. This displays the list of files that are already staged.4. Commit the file(s) as described in "Committing Sources to a Git Repository".
5. Commit the file(s) as described in "Committing Sources to a Git Repository".N/A