{"id":29449,"date":"2017-07-06T18:42:38","date_gmt":"2017-07-07T01:42:38","guid":{"rendered":"https:\/\/github.blog\/\/2017-07-06-introducing-code-owners\/"},"modified":"2019-01-15T21:23:50","modified_gmt":"2019-01-16T05:23:50","slug":"introducing-code-owners","status":"publish","type":"post","link":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/","title":{"rendered":"Introducing code owners"},"content":{"rendered":"<p>While effective code review is essential to every successful project, it&#8217;s not always clear who should review files\u2014even with GitHub&#8217;s reviewer suggestions. Now repository maintainers can define exactly which people and teams need to review projects using <a href=\"https:\/\/help.github.com\/articles\/about-codeowners\/\">code owners<\/a>. This new feature automatically requests reviews from the code owners when a pull request changes any owned files.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png?resize=2400%2C1260\" alt=\"Requested code owners\" width=\"2400\" height=\"1260\" \/><\/p>\n<h3 id=\"how-code-owners-work\"><a class=\"heading-link\" href=\"#how-code-owners-work\">How code owners work<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>To specify code owners, create a file named <code>CODEOWNERS<\/code> in the repository&#8217;s root directory (or in <code>.github\/<\/code> if you prefer) with the following format:<\/p>\n<pre><code># Lines starting with '#' are comments.\r\n# Each line is a file pattern followed by one or more owners.\r\n\r\n# These owners will be the default owners for everything in the repo.\r\n*       @defunkt\r\n\r\n# Order is important. The last matching pattern has the most precedence.\r\n# So if a pull request only touches javascript files, only these owners\r\n# will be requested to review.\r\n*.js    @octocat @github\/js\r\n\r\n# You can also use email addresses if you prefer.\r\ndocs\/*  docs@example.com<\/code><\/pre>\n<p>This format may be familiar if you&#8217;ve used <a href=\"https:\/\/git-scm.com\/docs\/gitattributes\"><code>gitattributes<\/code><\/a>.<\/p>\n<p>With that in place, code owners will automatically be requested for review whenever a pull request touches the files they own.<\/p>\n<h3 id=\"an-extra-layer-of-code-security\"><a class=\"heading-link\" href=\"#an-extra-layer-of-code-security\">An extra layer of code security<span class=\"heading-hash pl-2 text-italic text-bold\" aria-hidden=\"true\"><\/span><\/a><\/h3>\n<p>For projects with more rigorous review processes, we&#8217;ve also added a new <a href=\"https:\/\/help.github.com\/articles\/about-protected-branches\/\">protected branch option<\/a> to ensure the right people have a chance to review.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"attachment-full size-full\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803663-a4bb073e-5ff8-11e7-9c45-2c3cbdc999cd.png?resize=2400%2C1260\" alt=\"require code owners setting\" width=\"2400\" height=\"1260\" \/><\/p>\n<p>With protected branches enabled, a code owner for each owned file has to leave a review before anyone can merge a pull request to that branch.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"attachment-full size-full\" src=\"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803610-544ba222-5ff8-11e7-9313-e4062315fb0c.png?resize=1556%2C684\" alt=\"waiting on code owner review\" width=\"1556\" height=\"684\" \/><\/p>\n<p>We hope this helps make your review process even more effective. Let us know if you have any feedback on code owners using our <a href=\"https:\/\/github.com\/contact?form%5Bsubject%5D=Code%20Owners\">help form<\/a>.<\/p>\n<p><em>The code owners feature was inspired by Chromium&#8217;s use of <a href=\"https:\/\/chromium.googlesource.com\/chromium\/src\/+\/master\/docs\/code_reviews.md#OWNERS-files\"><code>OWNERS<\/code> files<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>While effective code review is essential to every successful project, it&#8217;s not always clear who should review files\u2014even with GitHub&#8217;s reviewer suggestions. Now repository maintainers can define exactly which people&hellip;<\/p>\n","protected":false},"author":1296,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_gh_post_show_toc":"","_gh_post_is_no_robots":"","_gh_post_is_featured":"","_gh_post_is_excluded":"","_gh_post_is_unlisted":"","_gh_post_related_link_1":"","_gh_post_related_link_2":"","_gh_post_related_link_3":"","_gh_post_sq_img":"","_gh_post_sq_img_id":"","_gh_post_cta_title":"","_gh_post_cta_text":"","_gh_post_cta_link":"","_gh_post_cta_button":"","_gh_post_recirc_hide":"","_gh_post_recirc_col_1":"","_gh_post_recirc_col_2":"","_gh_post_recirc_col_3":"","_gh_post_recirc_col_4":"","_featured_video":"","_gh_post_additional_query_params":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"_links_to":"","_links_to_target":""},"categories":[3321,3325],"tags":[],"coauthors":[],"class_list":["post-29449","post","type-post","status-publish","format-standard","hentry","category-news-insights","category-product-news"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Introducing code owners - The GitHub Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introducing code owners\" \/>\n<meta property=\"og:description\" content=\"While effective code review is essential to every successful project, it&#8217;s not always clear who should review files\u2014even with GitHub&#8217;s reviewer suggestions. Now repository maintainers can define exactly which people&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/\" \/>\n<meta property=\"og:site_name\" content=\"The GitHub Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-07T01:42:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-16T05:23:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png\" \/>\n<meta name=\"author\" content=\"Jared Pace\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jared Pace\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/\"},\"author\":{\"name\":\"Jared Pace\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/b11cc435782da91428ac6f3766e9e2e5\"},\"headline\":\"Introducing code owners\",\"datePublished\":\"2017-07-07T01:42:38+00:00\",\"dateModified\":\"2019-01-16T05:23:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/\"},\"wordCount\":216,\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png\",\"articleSection\":[\"News &amp; insights\",\"Product\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/\",\"url\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/\",\"name\":\"Introducing code owners - The GitHub Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png\",\"datePublished\":\"2017-07-07T01:42:38+00:00\",\"dateModified\":\"2019-01-16T05:23:50+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/b11cc435782da91428ac6f3766e9e2e5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#primaryimage\",\"url\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png?fit=2400%2C1260\",\"contentUrl\":\"https:\\\/\\\/github.blog\\\/wp-content\\\/uploads\\\/2017\\\/07\\\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png?fit=2400%2C1260\",\"width\":2400,\"height\":1260,\"caption\":\"requested code owners\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/introducing-code-owners\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/github.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"News &amp; insights\",\"item\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Product\",\"item\":\"https:\\\/\\\/github.blog\\\/news-insights\\\/product-news\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Introducing code owners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/github.blog\\\/#website\",\"url\":\"https:\\\/\\\/github.blog\\\/\",\"name\":\"The GitHub Blog\",\"description\":\"Updates, ideas, and inspiration from GitHub to help developers build and design software.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/github.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/github.blog\\\/#\\\/schema\\\/person\\\/b11cc435782da91428ac6f3766e9e2e5\",\"name\":\"Jared Pace\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g1f7672d9a25ccd2099eed031da174f46\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g\",\"caption\":\"Jared Pace\"},\"url\":\"https:\\\/\\\/github.blog\\\/author\\\/jdpace\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introducing code owners - The GitHub Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/","og_locale":"en_US","og_type":"article","og_title":"Introducing code owners","og_description":"While effective code review is essential to every successful project, it&#8217;s not always clear who should review files\u2014even with GitHub&#8217;s reviewer suggestions. Now repository maintainers can define exactly which people&hellip;","og_url":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/","og_site_name":"The GitHub Blog","article_published_time":"2017-07-07T01:42:38+00:00","article_modified_time":"2019-01-16T05:23:50+00:00","og_image":[{"url":"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png","type":"","width":"","height":""}],"author":"Jared Pace","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jared Pace","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#article","isPartOf":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/"},"author":{"name":"Jared Pace","@id":"https:\/\/github.blog\/#\/schema\/person\/b11cc435782da91428ac6f3766e9e2e5"},"headline":"Introducing code owners","datePublished":"2017-07-07T01:42:38+00:00","dateModified":"2019-01-16T05:23:50+00:00","mainEntityOfPage":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/"},"wordCount":216,"image":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png","articleSection":["News &amp; insights","Product"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/","url":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/","name":"Introducing code owners - The GitHub Blog","isPartOf":{"@id":"https:\/\/github.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#primaryimage"},"image":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#primaryimage"},"thumbnailUrl":"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png","datePublished":"2017-07-07T01:42:38+00:00","dateModified":"2019-01-16T05:23:50+00:00","author":{"@id":"https:\/\/github.blog\/#\/schema\/person\/b11cc435782da91428ac6f3766e9e2e5"},"breadcrumb":{"@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#primaryimage","url":"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png?fit=2400%2C1260","contentUrl":"https:\/\/github.blog\/wp-content\/uploads\/2017\/07\/27803645-87c9a9c8-5ff8-11e7-91d7-2fa0718e6871.png?fit=2400%2C1260","width":2400,"height":1260,"caption":"requested code owners"},{"@type":"BreadcrumbList","@id":"https:\/\/github.blog\/news-insights\/product-news\/introducing-code-owners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/github.blog\/"},{"@type":"ListItem","position":2,"name":"News &amp; insights","item":"https:\/\/github.blog\/news-insights\/"},{"@type":"ListItem","position":3,"name":"Product","item":"https:\/\/github.blog\/news-insights\/product-news\/"},{"@type":"ListItem","position":4,"name":"Introducing code owners"}]},{"@type":"WebSite","@id":"https:\/\/github.blog\/#website","url":"https:\/\/github.blog\/","name":"The GitHub Blog","description":"Updates, ideas, and inspiration from GitHub to help developers build and design software.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/github.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/github.blog\/#\/schema\/person\/b11cc435782da91428ac6f3766e9e2e5","name":"Jared Pace","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g1f7672d9a25ccd2099eed031da174f46","url":"https:\/\/secure.gravatar.com\/avatar\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5df244df5fb0f300ea56a93cd10c1764eb4d1e0ae16217767f0ea29966122d36?s=96&d=mm&r=g","caption":"Jared Pace"},"url":"https:\/\/github.blog\/author\/jdpace\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pamS32-7EZ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/29449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/users\/1296"}],"replies":[{"embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/comments?post=29449"}],"version-history":[{"count":2,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/29449\/revisions"}],"predecessor-version":[{"id":46945,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/posts\/29449\/revisions\/46945"}],"wp:attachment":[{"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/media?parent=29449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/categories?post=29449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/tags?post=29449"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/github.blog\/wp-json\/wp\/v2\/coauthors?post=29449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}