Is your Git repo a hot mess? Ours was too
Tags: github, codeowners, softwaredevelopment, chromeextension
Published: 2020-01-27 12:21:04

---
title: Is your Git repo a hot mess? Ours was too
published: true
date: 2018-05-22 12:11:59 UTC
tags: github,code-owners,software-development,chrome-extension
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/1*jArs7qA1LiBmF0MQYf-FVw.jpeg)<figcaption>repos all over the place</figcaption>

Remember that time you wanted to have a small get together at your apartment? You invited a few of your friends, bought a few drinks and put on some good music… then your friend Bob invited his roommates, your friend Alice invited her co-workers and all of a sudden it was a full blown party. It was a chaos.

Now think about your Git repo. Similar to the party, when there were only a few developers working on the same repo, everything was in order. But when a bunch of developers started showing up, it got a little out of hand.

At Soluto, we have two main repos with more than 100 developers worldwide making commits everyday. When we first started, everyone could push new code to a single master branch and it soon became a mess. Then we started requiring a PR (pull request) in order to push new code. It worked well for a while, but it wasn’t clear who should review the PR for each part of the code, and some chunks of code were neglected completely.

### Code owners to the rescue

Github [introduced](https://blog.github.com/2017-07-06-introducing-code-owners/) a new cool feature last year called code owners. Code owners lets you define which team or developer is the owner of each piece of code. It’s super easy to use, and it introduced an efficient method of reviewing changes in a big repo.

#### How it’s done

All you have to do is define a _CODEOWNERS_ file that uses a pattern with the same rules as _.gitignore_ files. Then, in each PR the owners of the changed parts of the code will be required to approve the PR in order to merge it to the master branch. If you want to learn more about code owners, click [here](https://help.github.com/articles/about-codeowners/).

Now, you got yourself some organized code with well-reviewed PRs. You and other developers are more committed to the code, get to know it better and are more confident when pushing new code to production.

### Taking it to the next level

Code owners changed the way we work and we love it. But, we often noticed that in big PRs — with many changed files — there were multiple owners who were requested to review the PR. It soon became tedious for the owners to track which files they had to review.

![](https://cdn-images-1.medium.com/max/310/0*RfwjKC4TtgPpYxEq.gif)

#### Introducing code owners Chrome extension

We developed a simple and useful Chrome extension that allows the code owner to click a button and instantly see _only_ the files he’s the owner of. What’s going on behind the scenes, you may ask? Firstly, it locates the _CODEOWNERS_ file, then identifies the files of which you’re the owner and need to review, filtering out the rest of the changed files. How cool is that?

![Code owners chrome extension](https://cdn-images-1.medium.com/max/997/0*AOCvvR06zK5dtOWN.jpg)

So, now the code is more organized and clean because of the PRs. The developers know the code better thanks to the code owners feature. And the reviewers are happy to review code in a more efficient way with our awesome extension. 😉

If you want to try out our chrome extension, it’s available for download [here](https://chrome.google.com/webstore/detail/codeowners/mklphhfajjbikchaodnibnjmeibbonhb).

Feel free to add any issues or PRs on our [Github](https://github.com/code-owners/codeowners-ext) — this will help us out in improving the extension.

_Originally published at_ [_Soluto Engineering Blog_](https://blog.solutotlv.com/is-your-git-repo-a-hot-mess-ours-was-too/)_._

* * *