Use the .gitignore file

Completed

When you work with a version control system, you might not want to store all files within Git. For Business Central, we can leave the different .app files and some .json files out of the version control system.

  • Symbol files: These files are dependent on the version you're deploying to. It's best is to download the symbol files from within Visual Studio Code when you work on the extension.

  • Launch.json: This file contains the information of which server you as a developer use during your development to deploy and test your extension. This is often a Docker Image running on your own computer and is different for each developer. This file shouldn't be added to source control and should be generated on the developer's machine.

  • Rad.json: This file is used in rapid application development and contains a list of files that are modified since previous modification and helps in a faster deploy during development. This file is different for each developer and constantly changes. It's recommended to not include this file in Git.

  • Application .app file: The result of a build within Visual Studio Code is an .app file of your extension. This .app file is recreated with every build and shouldn't be included within Git. A build (and eventually a release) pipeline will create a new .app file within Azure DevOps.

To indicate which files should be part and which files should not, you can create a .gitignore file. This file is a text file that contains a list of files that should be excluded. You can also specify a directory or files with a specific file extension.

The easiest way to create this file or add an entry to this file is to use the built-in functionality of Visual Studio Code.

  1. Click View in the menu and select SCM (Ctrl+Shift+G).

  2. In the Source Control Explorer, you can right-click a file and select Add to .gitignore.

    Screenshot of the Add to .gitignore on the right click menu.

To ignore all .app files, (or only those in .alpackages) you can use the following entries.

*.app or .alpackages/*.app