What is the best way to use Source Control when there is no merge?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 10:35 AM
We are considering using source control integration for our scoped applications, but there appears to be some idiosyncrasies and were wondering how others deal with them.
First off, we have one development instance with multiple developers. I have also watched https://youtu.be/VY3x9GzpT6s and read through https://docs.servicenow.com/bundle/london-application-development/page/build/applications/concept/c_....
My thought of how the process should work would be something like:
- The master branch always matches whatever has been published.
- When we want to enhance/change our application, we create a branch from the master branch.
- As we go along, we commit our changes.
- When we are happy with our enhancement/change, we merge the branch into the master branch and publish the master branch.
The problem with the above scenario is Step 4. There is no functionality in Studio to merge a branch back into the master branch. Also, ServiceNow states we should not be doing things like merges from within the repository (like GitHub).
Given the lack of merge, I thought maybe the best process would be something like:
- The master branch always matches whatever has been published.
- We create another branch called "Enhancements" off of the master branch. This would effectively be a permanent branch where work actually happens.
- We do all of our changes in the Enhancements branch, but never Commit Changes.
- When we are happy with everything in the Enhancements branch, we Stash Local Changes. We then apply the stash to both the master and Enhancements and publish the master branch.
The problem with that process is that if someone accidentally Commits Changes they will no longer be able to Stash Local Changes. They will then have no ability to merge the changes back into the master.
How are others using source control if there is no merge functionality to bring changes back to the master branch? Or, am I fundamentally not understanding something?
Thanks.
- 2,290 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 12:02 AM
Hello,
Please refer below links for your query:
https://community.servicenow.com/community?id=community_blog&sys_id=407ceea1dbd0dbc01dcaf3231f961911
Please mark correct & helpful; if it's useful to you.
Thanks & Regards,
Pooja Devkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2019 06:05 AM
Hi Pooja,
Thanks for the links, but they re-iterate the difficulties I see with using source control, as delivered, in ServiceNow.
From https://community.servicenow.com/community?id=community_blog&sys_id=407ceea1dbd0dbc01dcaf3231f961911
"10. Cannot Merge Source Control Branches
While I can create branches of my application in my external repository (i.e. GitLab); I cannot merge them. BTW, it doesn't work to go merge them in the repository itself then download the "new" merged copy back to your instance via the Studio. "
"2. If you want to merge code between branches and back into the master, you need to make sure you create a Stash of your local changes BEFORE you commit to the repository.
3. There's no easy way to merge code back into the master outside of Stashes - if you forget to stash before you commit, then I suspect you'll probably need to make a minor change to the file so that it writes the entire XML of the file to the update set again, then you could probably save it as a stash again before manually applying the stash back to the master branch."
Brad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2019 06:13 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2022 01:59 AM
We do not have a merge feature in ServiceNow but by now we do support merges happening in Source Control. Basically you can use any tool / process to merge changes from branches. Once the merge is complete we can pull the latest - merged - version back into ServiceNow.