Skip to main content

GitHub now lets you automatically request reviews from code owners when you make a change

GitHub mug.
Image Credit: GitHub

GitHub has announced a new feature that makes it easier to identify which people need to review changes that have been made to code in a repository.

Using code owners, you can define specific teams or individuals that are responsible for a piece of code so that when you make a pull request the relevant people are informed automatically.

To initiate code owners within a GitHub repository, you have to create a new file called CODEOWNERS in the root directory that adheres roughly to the following format:

Above: Codeowners File Example

Image Credit: GitHub

The principle behind code owners is, of course, nothing new — the company readily admits that it was inspired by Google’s open source Chromium web browser, which offers a feature called “owners files.”

Additionally, GitHub has also added “protected branches” to the mix, which ensure that project collaborators can’t make permanent changes to branches. It’s basically for projects with a more stringent review process, and with this feature enabled code owners for each file have to leave a review before any other collaborator can merge a pull request to that branch.

Above: Protected branches

These are actually super useful features for a code-hosting platform that claims 20 million users globally and 57 million repositories. It also comes hot on the heels of a number of other updates, including the launch of Topics, which helps users find repositories based on common themes.

The company also recently announced Open Source Friday, which, as its name suggests, encourages companies to dedicate time each Friday for employees to work on open source projects.

VB Daily - get the latest in your inbox

Thanks for subscribing. Check out more VB newsletters here.

An error occured.