PBIP and Git: what to commit and what to ignore

Power BI

A PBIP project is plain text, so Git can track it. Keep the local cache and your own settings out, and set Git up for the line endings Power BI Desktop writes.

The .gitignore Power BI Desktop writes

When you save as a PBIP, Power BI Desktop writes a .gitignore if the folder or its Git repository does not have one. If yours already has one, it does not write one, so add these two lines yourself:

The default .gitignore, as Microsoft Learn shows it.
**/.pbi/localSettings.json
**/.pbi/cache.abf

Source: Power BI Desktop projects (PBIP).

What to commit, file by file

FileIn GitWhat it is
.pbi/localSettings.jsonKeep outin the report and in the model: settings for you and your computer only. Keep it out of Git.
.pbi/cache.abfKeep outa backup of the model with its data. Keep it out of Git. Power BI Desktop can open the project without it, with the whole model and no data.
.pbi/editorSettings.jsonTrackededitor settings meant to be shared between people. The default .gitignore does not exclude it.
.pbi/unappliedChanges.jsonYour choicequery changes not yet applied. Git tracks it by default. You can exclude it so unfinished query work does not reach other developers.
.platformNot statedthe file that holds the link between the item in Fabric and Git.

Source: Power BI Desktop project semantic model folder, Power BI Desktop project report folder, Power BI Desktop projects (PBIP).

Data can be in the definition

Some report files, such as visual.json and bookmarks.json, can be saved with data values from your semantic model. Read them before you push to a shared or public repository.

Source: Power BI Desktop project report folder.

Line endings and encoding

  • Power BI Desktop writes CRLF line endings. Turn on Git's autocrlf setting so line endings do not fill your diffs.
  • Save any file you edit by hand as UTF-8 without a byte order mark.

Source: Power BI Desktop projects (PBIP).

Where to keep the repository

  • Keep the path short. Windows limits project file paths to 260 characters by default, and a longer path can make saves fail.
  • Do not save a PBIP straight to OneDrive or SharePoint. A locally synced OneDrive folder works, but can cause sync problems and failed saves.

Source: Power BI Desktop projects (PBIP).

Working with Git

Microsoft's walkthrough uses VS Code: Source Control, then Initialize Repository. Each save in Power BI Desktop then shows up as a diff of the files that changed.

Fabric Git integration reads only definition.pbir and ignores any other .pbir file in the report folder.

Source: Git integration with Power BI Desktop projects, Power BI Desktop project report folder.

Check a project in your browser

The Power BI Report Doctor reads a PBIP folder or .zip and lists the file and line to fix. Nothing is uploaded.

Other guides

Sources

Your JSON and text are processed entirely in your browser and are never sent anywhere. To understand how the site is used we record each page view (the page, the referrer and an approximate location from your IP address) and keep it for 90 days. Nothing is stored on your device unless you choose it. Accept to also store a device identifier here and record your browser and device characteristics, which is what lets a return visit be told from a new one. Decline and nothing is sent at all. We respect Do Not Track. See our privacy policy.