What is the best way to use Source Control when there is no merge?

bpippert
Tera Guru

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:

  1. The master branch always matches whatever has been published.
  2. When we want to enhance/change our application, we create a branch from the master branch.
  3. As we go along, we commit our changes.
  4. 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:

  1. The master branch always matches whatever has been published.
  2. We create another branch called "Enhancements" off of the master branch. This would effectively be a permanent branch where work actually happens.
  3. We do all of our changes in the Enhancements branch, but never Commit Changes.
  4. 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.

5 REPLIES 5

Thank you Daniel. It would be nice if we can manage all aspects of Source Control directly in ServiceNow. Similar to native full stack developer in vscode.