Sitemap
Shubh Prakash Shukla

Shubh Prakash Shukla

Git & ServiceNow: Version Control for Your Platform Code 🗂️

7 min readSep 4, 2026

ServiceNow already has Update Sets to move changes between instances — so why would anyone need Git too? Because Update Sets track what changed, but Git tracks why, when, and by whom, with proper branching, code review, and a permanent history that survives long after an instance gets refreshed. Let’s break down how Git actually plugs into ServiceNow. 👇

🔍 What Does "Git Integration" Mean in ServiceNow?
Source Control integration in ServiceNow means connecting an instance’s Application or Scoped App to an external Git repository (GitHub, GitLab, Bitbucket, Azure DevOps) so that platform artifacts — Script Includes, Business Rules, Widgets, Flow definitions — get versioned as actual code files, not just database records. 🔗
In simple words — instead of relying purely on Update Sets moving between Dev → Test → Prod, your application’s source lives in a real repository, with commits, branches, pull requests, and a history that any developer can audit outside the platform.
🧱 Core Building Blocks
1. Application Repository 📦
A ServiceNow Scoped Application or a set of files exported/synced to a Git repo — the container that gets version-controlled.
2. Source Control Plugin 🔌
ServiceNow’s built-in "Source Control Integration" plugin, which enables the connection between a Studio application and an external Git remote.
3. Studio 🛠️
The development environment (Studio) where developers work on scoped app files — this is the primary interface that talks to Git, rather than the classic UI.
4. Personal Access Token (PAT) 🔑
The authentication credential (from GitHub/GitLab etc.) that ServiceNow uses to connect to your repository — a password won’t work directly on most modern Git hosts anymore.
5. Commit, Push, Pull 🔄
Standard Git operations, now triggered from within Studio: commit local changes, push them to the remote repo, pull down changes made by teammates.
6. CI/CD Pipelines (Optional, Advanced) ⚙️
Once code lives in Git, external tools (Jenkins, GitHub Actions, Azure Pipelines) can automate testing and deployment — this is where ServiceNow development starts to look like standard software engineering.
🗺️ Navigation Path
Want to explore Source Control in your instance? Here’s how:
All Menu > System Applications > Studio — opens the scoped app development environment
Inside Studio: Source Control menu (top toolbar) → shows Connect, Commit, Push, Pull options once configured 🧭
🛠️ Step-by-Step: Connecting a ServiceNow App to Git
Step 1️⃣: Create (or choose) a Scoped Application

Git integration works at the Application level, not the whole instance. If your work isn’t already in a Scoped App, you’ll need to create one first — Global scope apps can’t be version-controlled this way.
Step 2️⃣: Create the remote repository
On GitHub (or your Git host of choice), create a new, empty repository. Copy its HTTPS URL.
Step 3️⃣: Generate a Personal Access Token
On GitHub: Settings > Developer Settings > Personal Access Tokens → generate one with repo scope. Copy it immediately — most hosts only show it once.
Step 4️⃣: Connect from Studio
Open your app in Studio → Source Control > Connect to Git Repository:
Repository URL: the HTTPS URL you copied
Username: your Git username
Password/Token: paste the Personal Access Token (not your account password)

Branch: usually main
Step 5️⃣: Initial Commit
Studio will show all current application files as pending changes. Write a clear commit message (e.g., "Initial commit — Dealer Transfer app") and Commit and Push.
Step 6️⃣: Ongoing workflow
From here, the loop is: make changes in Studio → Commit locally with a message → Push to the remote → teammates Pull the latest before starting their own work.
Step 7️⃣: (Optional) Set up CI/CD
Once code is in GitHub, you can wire up GitHub Actions or a similar tool to run automated tests (using ServiceNow’s ATF via API) whenever a pull request is opened — moving toward true continuous integration.
💡 Real-World Scenario: A Team Adopts Git (and Hits Friction)
Scenario: A 4-developer team moves their Scoped App from pure Update Sets to Git, expecting instantly smoother collaboration.
⚠️ Issue 1: Merge Conflicts on JSON-Heavy Files
What Happened: Two developers edited the same Flow Designer flow simultaneously. Since Flow definitions are stored as large, nested JSON, Git’s line-by-line diff produced an unreadable merge conflict neither developer could resolve manually.
The Fix: Establish a "one owner per flow at a time" convention for artifacts that don’t diff well (Flows, some Workspace configs), and communicate ownership before starting work. For genuinely collaborative files, keep changes small and commit/push frequently to minimize conflict windows.
⚠️ Issue 2: Update Sets and Git Getting Out of Sync
What Happened: One developer kept working the "old way" — capturing changes in an Update Set and manually applying them to another instance — while the rest of the team pushed to Git. The two histories diverged, and nobody could tell which was the source of truth.
The Fix: Pick one authoritative source per application and enforce it as policy: once an app is Git-connected, all developers commit through Studio’s Source Control menu — Update Sets get retired for that specific app, not run in parallel indefinitely.
⚠️ Issue 3: Sensitive Data Committed by Accident
What Happened: A developer’s Script Include had a hardcoded API key for a REST Message during testing — it got committed and pushed to a public GitHub repository before anyone noticed.
The Fix: Always use a private repository for ServiceNow application code unless there’s a specific reason not to, add a .gitignore-style discipline around credentials, and store secrets in ServiceNow’s Connection & Credential Aliases instead of hardcoding them anywhere. If a secret does leak, rotate it immediately — removing it from a later commit doesn’t erase it from Git history.
⚠️ Issue 4: Personal Access Token Expired Mid-Sprint
What Happened: A developer’s PAT had a 90-day expiration (a GitHub default for security), and pushes silently started failing with an authentication error mid-sprint — wasting time debugging what looked like a platform issue.
The Fix: When generating tokens, set expiration dates the team can track (or use a dedicated service account with a longer-lived token for CI/CD), and document the renewal process so it isn’t a surprise.
⚠️ Issue 5: Confusion Over What Actually Gets Version-Controlled
What Happened:
A developer assumed Git was capturing everything in the instance — including Global scope customizations, unrelated system properties, and ACLs outside the app — and was confused when those changes weren’t showing up in commits.
The Fix: Set expectations early: Source Control only tracks the files belonging to the connected Scoped Application. Anything in Global scope, or in a different app, still needs Update Sets or its own separate Git connection.
🌟 Unique Facts About Git & ServiceNow Most Developers Miss 🎓
1. 🧾 Every File Maps to an XML
Record Under the Hood
What looks like a "file" in your Git repo (a Script Include, a Business Rule) is actually an XML representation of the underlying database record — Studio handles the conversion both ways automatically, but it’s worth understanding when debugging a messy diff.
2. 🔀 You Can Use Standard Git Branching Strategies
Feature branches, pull requests, and code review aren’t just theoretical for ServiceNow — once connected, your app supports the exact same Git Flow or trunk-based development patterns used in traditional software teams.
3. 🕰️ Git History Survives Instance Clones and Refreshes
Unlike Update Set history (which can get messy or lost across instance clones), your Git commit history is completely independent of the ServiceNow instance — it lives on GitHub/GitLab regardless of what happens to Dev, Test, or Prod.
4. 🚫 Not Every Artifact Is Git-Friendly
Some ServiceNow components (large attachments, certain workspace configurations, some Now Experience Framework files) don’t version-control cleanly as text — teams often keep these on traditional Update Sets even after adopting Git for the rest of the app.
5. 🔍 You Can Review Platform Changes Like Code
Because commits are real Git commits, you get genuine pull request code review — a second developer can comment directly on a specific line of a Script Include’s diff before it merges, something Update Sets never supported natively.

Get Shubh Prakash Shukla’s stories in your inbox

Join Medium for free to get updates from this writer.

⚠️ Common Challenges Summary & Simple Solutions 🎯
Challenge

Simple Solution
Unreadable merge conflicts on Flows/JSON
Assign single ownership per artifact; commit small and often
Update Sets and Git drifting out of sync
Pick one source of truth per app; retire Update Sets for that app
Secrets accidentally committed
Use private repos + Credential Aliases; rotate any leaked secret immediately
Expired Personal Access Token breaks pushes
Track token expiration; use a service account for CI/CD
Team assumes Git covers everything
Clarify Git only tracks the connected Scoped App’s files

🎯 Pro Tip
Before connecting any app to Git, agree on a branching and commit-message convention as a team — even something simple like "one feature per branch, present-tense commit messages." Teams that skip this step end up with a Git history that’s technically version-controlled but practically unreadable, which defeats half the purpose of adopting Git in the first place.

🏁 Conclusion
Git integration is what makes ServiceNow development feel like real software engineering — proper history, code review, branching, and a source of truth that isn’t tied to any single instance. It doesn’t replace Update Sets entirely (Global scope work still needs them), but for Scoped Applications, it’s a meaningfully more robust way to collaborate, especially as a team — and once your code lives in Git, all of it (Flows, REST Messages, Script Includes) becomes something you can review, roll back, and reason about the same way any other engineer would. 🔗✨

--

--