Working with Version Control Systems in the MPLAB® X IDE

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

Choosing a version control system to work with MPLAB® X Integrated Development Environment (IDE) and store your project files is the first step. Working with the interaction of the repository and MPLAB X IDE is the next step.

Saving Project Files

Not all MPLAB X IDE project files need to be saved in a repository; some are automatically generated. The following table lists project files that either need or do not need to be committed to a version control repository.

Table: Project Files Saved to Repository

Directory or File(s)Commit?
Project directory
.generated_files directory
Makefile
Source files
build directory
dist directory
nbproject directory
configurations.xml
project.xml
Makefile-*
Package-*
private directory
Green Check: required to generate the project image.
Red X: these directories/files are regenerated and therefore do not need to be saved.

See MPLAB X IDE documentation for more information on the project structure.

For more on using local file history and/or source control, see the table of contents for the NetBeans help topics under IDE Basics > Using the IDE Help System > Versioning Applications with Version Control.

Resolving Conflicts in Version Controlled Files

Inevitably, conflicts will arise between a file you are trying to check-in and the same file in the revision system repository that others have modified.

To understand how conflicts can be resolved, see the example below.

Example: Conflict in configurations.xml

To resolve conflicts on the file configurations.xml:

  1. Conflicts will be announced in the MPLAB X IDE (a) warning dialogs and/or (b) the output window.
  2. Click on the Files tab in the Projects window. Expand the nbproject folder. Find the file named configurations.xml. It should be in red font, signifying conflicts.
  3. Right-click on configurations.xml and select RCS > Resolve Conflicts, where RCS is your revision control system. This will open the Merge Conflicts Resolver window.
  4. The Merge Conflicts Resolver window allows you to fix conflicts. For more information, see the table of contents for the NetBeans help topics under IDE Basics > Using the IDE Help System > Versioning Applications with Version Control.
  5. After fixing the errors, close the project. If the right-click context menu for the project does not work, close the project using File > Close Project.
  6. Reopen the project. The conflicts should be resolved.

Building a Project with Read-Only Files

To build a project where files have been checked into a repository and some may then be read-only:

  1. Commit the minimum number of files to source control. This is explained in Saving Project Files.
  2. Make the files nbproject/configurations.xml and nbproject/project.xml writeable.