Skip to main content
All CollectionsTroubleshootingComparisons
Common problems with viewing metadata in source control
Common problems with viewing metadata in source control

Issues seen with repo directory structures

Valerio Chang avatar
Written by Valerio Chang
Updated over 7 months ago

For Gearset to read your source control repository, the metadata in source control should be in the same Metadata API format as you use for Ant or Eclipse deployments (or alternatively in the SFDX source format - for more information on the different formats, see our article on structuring your source control repository).

When using the Metadata API format, within a branch, each metadata type should sit within its own folder. You may optionally place all of these folders within a single unpackaged folder if you wish, but you should not create a nested folder structure. 

If you are still having trouble getting Gearset to view your repository, check the common mistakes below.

Do you have 'Filter comparison by package.xml' selected in your comparison? 

Results from a comparison may be hidden if you have Filter comparison results by package.xml selected. For more information on how this works, please check this article.

Do you have a sfdx-project.json in your branch? 

If you have a SFDX source format repository, the sfdx-project.json file has to be present. The file determines the folder structure that Gearset expects in the root of the repository.

If your branch has a sfdx-project.json file in the root for reasons other than having a SFDX source format repository, you need to remove it for Gearset to be able to read the branch correctly.

Do you have a .forceignore file in your branch?

If you have a .forceignore file in your repo, Gearset will not retrieve the metadata items listed in the .forceignore files. Comment the items out to see the item you are looking for.

Do you have multiple /src directories or package.xml files in your branch? 

Gearset may find a /src/package.xml file and use that as the starting point of the comparison, so if you have multiple instances (for example, /november/src/package.xml and /december/src/package.xml), then Gearset may have problems determining which instance to render.

Can Gearset only see some objects but not others?

For example, within Custom Object, if you can see every object except one, say Accounts, there is a chance that the Account.object file is malformed or corrupted. This may be the result of a manual merge or a conflict that's pending a resolution.

The easiest way to test this is to substitute the Account.object file, with another temporary smaller well-formed object/xml file, to determine if the original is indeed malformed.

Can Gearset not see some fields in the comparison?

In SFDX source format repositories, we sometimes see users commit the object/object_name/fields/fieldname.field-meta.xml file, without the parent object/object_name.object-meta.xml, in the repository.

If the parent object does not exist in the repo, Gearset will not render the object and it's component fields. Please add the object/object_name.object-meta.xml file to the repo to resolve this issue.

Bitbucket specific - do you have more than 100 branches?

Some of you reported that you are unable to retrieve branches within your repo. If you are using Bitbucket, this is because of a Bitbucket API limitation of 100 branches allowed for retrieval.

If your Bitbucket repository has more than 100 branches, do the following:

  1. Try retrieving another repo with fewer than 100 branches to confirm this is the reason you can't view the branch you want.

  2. Delete unused branches in your repo.

GitHub specific - Can you not see the repository or branches?

Check if you can see your repo in https://github.com/settings/repositories, if the repo is not visible there, Gearset may have difficulty accessing it. Can you check the permissions to that repo from your git connection credentials?

If the application is caching old repos and branch and not updating new ones you just created, trying with a different browser or an Incognito tab is a good way to force the cache to be refreshed.

Also check that your organization has granted access to Gearset to view the repository.

In SFDX source format repos, is an Apex class, Custom object or Lightning component not showing up?

Do you have the corresponding .cls-meta.xml for each .cls  file?
Do you have the corresponding .cmp-meta.xml for each .cmp  file?

Do you have the corresponding .object-meta.xml for each object in the object directory?

Do you have a .forceignore file that is set to exclude that source file/directory?
That could be the reason Gearset isn't picking up the component.

Did this answer your question?