Skip to main content
Mastering your Git repositories
Share on socials
A illustration of a bucket with a wizard hat
Natalia Chebotareva
Natalia Chebotareva
15th June, 2023
Data center icon
Server icon

Mastering your Git repositories

Good Git practice is incredibly important: here are four ways to better manage, protect, and enforce standards using ScriptRunner for Bitbucket.
Git is an essential tool for any developer, allowing you to easily track changes to code and collaborate with others. However, just like documentation or file systems, it can get messy. There are a lot of moving pieces, different projects being developed quickly and many people working on the same things. Establishing a set of best practices is critical to the effectiveness of your Git repositories.
We felt that good Git practice is so important that we developed an app to help monitor Bitbucket. Here are four ways to better manage, protect, and enforce standards using ScriptRunner for Bitbucket.

1. Keep your branches up to date

Working in a team with multiple projects can result in pull requests taking quite a long time to be merged. That results in branches falling behind the master, which is not ideal. A branch too far out of date can take a ridiculously long time to merge while you sit and twiddle your thumbs. However, you can use ScriptRunner for Bitbucket to warn users how many commits their branch is behind and avoid large, time-consuming merge conflicts.
Keep your branches up to date

2. Standardise and enforce naming

There's a reason that companies adopt naming standards. Standardising allows for better organisation and tracking of pull requests, in addition to aiding the traceability of work.
Bitbucket natively comes with the ability to include the prefixes onto different types of pull requests (bugs, features and releases), but ScriptRunner for Bitbucket enables you to automatically begin pull requests with preset variables or change request IDs as well. This results in more granular and detailed pull request name types.
Branch and Tag Naming Standards Enforcement

3. Track every branch in one place

As you develop, it's important to make sure every single branch is tracked in Jira. The last thing any developer wants to run into is a surprise bit of code that starts breaking things when you mess with it. Again, ScriptRunner for Bitbucket can help by ensuring all branches are tracked in Jira. So if in the future, you need to refer back to something, you have enforced traceability. Nothing gets past you and ScriptRunner for Bitbucket.
Require Commits to be Associated with a Valid Jira Issue

Learn more about connecting commits with Jira

4. Recommended configurations

The Blueprint - Getting Started built-in script can be used when setting up new Bitbucket instances. It offers a selection of recommended and widely-used configurations you can choose to apply to your project and repositories. For example, this script can help you set up new projects/repositories or enforce restrictions across projects/repositories.
Blueprint - Getting Started feature
A well-maintained repository enhances teamwork, simplifies maintenance, and reduces conflicts. It fosters better code quality, streamlines development processes, and facilitates troubleshooting. It's all easier with ScriptRunner for BitBucket.

Try ScriptRunner for Bitbucket

To find out what else ScriptRunner for Bitbucket has up its sleeve, start your free trial today.