Git Process (Merging and Pushing)#
Developers comfortable with Git may use the terminal instead of SourceTree. For a command overview, see the Atlassian Git glossary.
Always pull the latest remote changes into your working branch before starting or merging work.
Naming and commit-message rules#
Name each feature branch after its Jira ticket number — e.g. MD-4369.
Each commit message must include the ticket key and a concise description of the changes.
How to create a feature branch in SourceTree#
The development branch is DbChanges_Staging. Create every standard feature branch from the latest version of this branch.
- Select Git-flow.
- Set the development branch to
DbChanges_Staging, then click OK. This initialization is required only once. - Open Git-flow again and select Start New Feature. Repeat this step whenever you create a feature branch.
- Enter the Jira ticket number as the feature name, then click OK.
How to push and pull in SourceTree#
After completing the ticket changes — including any database SQL files — review the File Status tab and confirm that only your intended changes are included.
- Select the changes and Stage them.
- Enter the commit description and click Commit.
- When the outgoing commit appears, click Push.
- Select only your feature branch, then click Push again.
Additional rules:
- Every time you work on a new branch, check that
DbChanges_Staginghas been pulled with the latest updates before creating the branch. - Before pulling, review local file changes to prevent conflicts. Discard unintended local changes, or resolve / stash the files that must be retained.
- Use Stash when local changes must be retained temporarily.
- When adding a package dependency, include all related configuration and project files in the commit, e.g.
packages.config,Site/site.csproj. - Do not commit unnecessary generated build files.
- When adding new HTML or C# files, include the corresponding
.csprojupdate containing their paths. Visual Studio should generate this automatically.
How to merge with different environments#
Release-2andRelease-3are release branches. Merge into them only when required by the ticket or its Fix Version/s configuration.
Merging into DbChanges_Staging (SourceTree)#
- Pull the latest changes from
DbChanges_Staging. - Check out the feature branch you are going to merge.
- Finish Feature.
- Fix conflicts (if any).
- Push changes into
DbChanges_Staging(or the release branch). - Verify that everything works properly.
Feature branch created from a release branch#
- Ensure your feature branch is up to date with the latest changes from the release branch.
- Merge the feature branch into the release branch.
- Resolve any conflicts, then commit.
Feature branch created from DbChanges_Staging, but the change must also land on a release branch#
- Identify the merge commit on your feature branch that you want to include in the release.
- Note its commit hash.
- Switch to the release branch.
- Cherry-pick the merge commit from your feature branch into the release branch.
- Resolve any conflicts, then push the changes.
- Verify that everything works properly.
Database scripts#
Run and commit database scripts through ApexSQL Source Control, using the same ticket-based commit-message rules. All script files are stored in the TSQL folder.
When modifying an existing SQL file (stored procedure, trigger, etc.), add a change comment inside the file.
Rollback procedures#
Use git log to view the commit history and identify the commit hash you want to roll back to. Then use git revert to create a new commit that undoes the changes. Revert only your own changes. After reverting, verify that the project works properly.
Resolving conflicts#
If you encounter merge conflicts:
- Locate each conflicted file and resolve the differences. Git conflict blocks are marked with
<<<<<<< HEAD,=======, and>>>>>>> branch-name. - Compare both versions carefully and integrate the required changes without omitting or duplicating lines.
- After resolving all conflicts, commit the result and push it to the intended branch.
- Verify the application functions correctly after the merge.
SprintQB (ManexCloud project)#
If your ticket is related to the ManexCloud project:
- Use the
SprintQBbranch and create the feature branch from it. - Run Visual Studio as an administrator when working with ManexCloud.
Manex Service (Cube Service)#
- Implement and test the fix in the
ManexServiceproject. - Push code changes to your feature branch.
- Publish the
.exefile and attach it to the ticket for testing. - After final validation, upload the
.exeto the SharePoint release folder.