You can now access these Library scripts from the script console in ScriptRunner for Jira, Confluence and Bitbucket Data Center. Learn more.

Discover

Apps

Products

Platforms

Types

Status

Features

Tags

Search Results

345 Results

Block Unwanted Files from Being Pushed

Overview

When pushing a commit, this custom pre-hook checks the files being pushed against a server side .gitignore template. If any of the files match those specified in the .gitignore template, the push is rejected.

This script was created and provided by GAIN Capital.

Example

Binaries increase repo size, which swells disk space consumption and enlarges git clone time locally and in other systems such as on a CI/CD server. Destroying files and associated history in Git is not easy and discouraged, so binaries should be rejected from the outset.

Good to Know

  • With this custom pre-hook, ScriptRunner for Bitbucket rejects the push with a ...