Skip to main content
  1. Posts/

These settings in Bitbucket/GitHub recommends enable

·282 words·2 mins· ·
Xianpeng Shen
Author
Xianpeng Shen
Table of Contents

As I have management our team’s git repositories for more than two years, and as my daily work using Bitbucket, so I’ll take it as an example.

Here are some settings recommend you to enable.

  1. Set Reject Force Push
  2. Set Branch Prevent deletion
  3. Set tags for each hotfix/GA releases
  4. Merge Check -> Minimum approvals (1)
  5. Yet Another Commit Checker

Reject Force Push
#

This is the first setting I highly recommend you/your team to open it. if not, when someone using the git push -f command to the git repository, you may lost commits if his local code is old then remote repository.

you have to recover the lost commits manually, I have heard 3 times around me. so enable the hook: Reject Force Push ASAP!

Set Branch Prevent deletion
#

If some branch is very important, you don’t want to lost it, set Branch Prevent deletion ASAP!

Set tags for each hotfix/GA releases
#

For each hotfix/GA release, highly recommend create tags after release.

Merge Check
#

Pull Request is a very good workflow process for each team. in case of commits were merged directly without review, we enable Minimum approvals (1).

So, every branch wants to be merged to the main branch MUST add a reviewer (not allow yourself) and the review must click the Approve button otherwise the merge button is disabled.

Yet Another Commit Checker
#

This is a very powerful feature. it helps to standardize commit messages and create a branch.

More details about this tool you can refer to this introduction

I have a Chinese article to describe how to use Yet Another Commit Checker implement. if you interest it, you can see the post here

Related

git sparse-checkout enable and disable
·127 words·1 min
This article explains how to enable and disable git sparse-checkout, including examples of how to configure sparse-checkout for specific directories and how to reset it.
Programmer's Self-Cultivation — Git Commit Message and Branch Creation Conventions
·1643 words·4 mins
This article introduces how to formulate and implement Git commit message and branch creation conventions to improve code quality and team collaboration efficiency.
Obtaining Bitbucket Repository Events in Real Time via the generic-webhook-trigger Plugin
·409 words·2 mins
This article describes how to use Jenkins’ generic-webhook-trigger plugin to obtain real-time event information from a Bitbucket repository, such as the Pull Request ID.
Bitbucket Webhooks Configuration
·398 words·2 mins
How to configure Bitbucket webhooks to trigger Jenkins builds for multi-branch pipelines, ensuring that Jenkins can automatically respond to events like pull requests and branch updates.
How to Slim Down Your Git Repository
·1133 words·6 mins
How to remove unnecessary files and history from a Git repository to reduce its size, providing two methods using BFG Repo Cleaner or git filter-branch.
Git History Statistics Generator
·712 words·4 mins
GitStats, a Git history statistics generation tool written in Python, can generate detailed code submission statistical reports to help developers analyze project activity and contributor information.