- SalesforceChaCha
- Posts
- 💃 Git Basics for Salesforce Pros 🕺
💃 Git Basics for Salesforce Pros 🕺
The beating ❤️ of modern DevOps
Good morning, Salesforce Nerds! How’s your Git game? 😉
Is your team using a Version Control System with a fully automated CI/CD pipeline?
Or are you still struggling with change sets?
Maybe you’re somewhere in the middle? 😐️
Whatever the case … if you need a quick run-down on what this stuff means, how some of it works, and what the benefits are then read on!

TABLE OF CONTENTS
Git Basics for Salesforce Pros
What’s the big deal?
Let’s get some context
How many times have you had a feature enhancement or new functionality you’ve built overwritten? 😡
✅ Request comes in from the business
✅ You diligently work on it
✅ Deploy it to a QA or UAT org for testing
All you need now is sign off from the business and you’re good to promote to Production! 🔥
UAT is scheduled and executed …
But, wait - what happened? Nothing is working now. 😕
It was legit just working in your environment!
You check the code or flow or page layout (whatever it is) and it’s most definitely NOT what you just got done building out. 🤔
After a few F-bombs 💣️ and some digging you discover your teammate was making changes to the same code or flow or page layout in her environment.
Your deployment went through right before hers and now all your changes in the UAT environment are gone. 😱
What now? How do you get your changes re-introduced? How do you do it without overwriting your teammates changes, too?
Version Control to the rescue!
What’s it all about?
What you need is Version Control. 💯
The problem listed above 👆️ is NOT a new one in the world of software engineering.
Teams have struggled with this problem since the early days of deploying changes through a series of orgs.
Version Control is a core tool 🛠️ that underpins a solid release management strategy.
As teams grow in size and orgs grow in complexity we need a way to merge changes made in different environments safely.
Version Control offers a solution to this and a handful of other deployment booby-traps! 🪤
Some of high-level awesomeness you’ll get is listed here:
✅ Version control tracks changes to files over time
✅ The main branch replaces your production org as the “single source of truth”
✅ Review & integrate changes from multiple sources
✅ Sets you up for automated deployments
Learning the basics
Time to dip our toes in!
There are really three (3) main concepts to remember:
✅ Branching
When you need to spin up new functionality you start by creating a new branch off the main branch. These are referred to as “feature” branches. These include a copy of ALL the files from the main branch and act as siloed area for you to safely make changes! ⤴️
✅ Committing
While you’re working in your branch it’s important to “commit” your changes into the branch. It’s best practice to commit often! Your feature branch will contain multiple commits that each represent a small change to your org. With Github or Bitbucket you can easily find and review the changes contained in each commit. 🤙
✅ Pull Requests
Now the fun part! When you’re work is complete in your branch you create something called a “pull request”. This is basically telling your Version Control System that you want to merge all the changes contained in your branch into the main branch. This provides a way for changes to be reviewed & approved before they are merged. Even automated! 🤖
The simplest image I can find to illustrate these concepts come from our good friends at Gearset!
Check it out 👇️

Simple workflow example
In this example, we have a main branch (called Master here) with a single feature branch spun up off of it. There are two commits into the feature branch and then a merge (with a PR) back in to the main branch. 🔥
What’s in this for me?
Some of the benefits
There’s a lot. 🤷
I’ll just list a few here. I’m not kidding when I say there’s a 💩-ton of material online you can find for this part!
✅ Collaboration - it’s a native system for reviewing & approving features.
✅ Increased release velocity - Deployments are faster and more frequent.
✅ Lower risk releases - Faster deployments result in faster feedback loops.
✅ High quality releases - Faster feedback loops lead to more relevant features for your users.
✅ Automate all the things - CI/CD relies on a modern Version Control System
SOUL FOOD
Today’s Principle
"Indeed, no one can thwart the purposes of your mind - for they can’t be touched by fire, steel, tyranny, slander, or anything."
and now....Salesforce Memes



What did you think about today's newsletter? |