Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can't link my application to github

cbarlock
Kilo Guru

I just spent two days rebuilding an application because it would not load cleanly when importing it from github.  In github, I renamed my existing repo and created a new, empty repo with the old name.  In Studio, I did Link to Source Control and pointed to the new repo.  I got:

Unable to export. Remote repository contains a different application

What would make Studio think this when there are no files in the repo?

1 ACCEPTED SOLUTION

cbarlock
Kilo Guru

Found a video with the answer.  Go to sys_repo_config.list , delete the repo connection and link to source control again.

View solution in original post

6 REPLIES 6

Ofer1
ServiceNow Employee
ServiceNow Employee

I posted a video which may help you solve the problem:

https://youtu.be/PODQW0ApywM?list=PL5DgOfLBA3RZ2BvcbNxdNtd3Y_1tW-hG9&t=140

Everything your development team needs to know about branching and managing stashed. How to solve ServiceNow "Repository does not contain an Application file to import" Error

Nilesh Salunke
Tera Contributor

Here’s a concise reply you can post under that thread:


I’ve hit this exact error when importing from GitHub. It isn’t the fork or OAuth—Studio can’t “see” the app because the branch is missing the app fingerprint. Two files fix it:

Add these at the repo root (on the branch you’re importing):

  1. sys_app_<APP_SYS_ID>.xml

    • From the source instance: System Applications → My Company Applications → your app → Export → XML.

    • Save/commit it as sys_app_<that app’s sys_id>.xml (exact filename).

  2. sn_source_control.properties

    path=/
    application_id=<APP_SYS_ID>
    application_scope=<your_scope_or_global>
    application_name=<Your App Name>

(Optional but fine to have: checksum.txt.)

Then try Import from Source Control again. If Studio prompts for checksum, click Recover/Repair.

Why this happens (especially after a fork):

  • Some branches don’t include the app record export or the properties file.

  • Studio requires both at repo root to recognize the branch as an application.

Quick checks

  • The <APP_SYS_ID> in the XML and properties must match the app you’re importing.

  • Files are at repo root (not in a subfolder).

  • One branch == one app (don’t put multiple sys_app_*.xml files in one branch).

  • Your token has repo read (and write if Studio needs to create a sanitized commit).

When not to use this:

  • For installing to other instances/orgs, prefer Application Repository (or Store). The Git route is for source/PR workflows, not distribution.

This has worked consistently on PDIs and enterprise instances once those two files are present.