{"id":89160,"date":"2023-08-04T08:21:24","date_gmt":"2023-08-04T08:21:24","guid":{"rendered":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/"},"modified":"2023-08-04T08:21:24","modified_gmt":"2023-08-04T08:21:24","slug":"github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository","status":"publish","type":"post","link":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/","title":{"rendered":"GitHub Copilot can now tell developers when its suggestions match code in a public repository"},"content":{"rendered":"<p><\/p>\n<div>\n<p id=\"speakable-summary\">GitHub Copilot has changed how developers write their code. However, it can also create issues when it creates code similar to what\u2019s already available in another public repository. In 2022, GitHub launched a feature that allowed users to block suggestions of matching public code automatically. According to a GitHub spokesperson, this system would trigger less than 1% of the time. But sometimes, developers may want to see what these code fragments are \u2014 either to use them (within the licensing restrictions set up by their companies) or to maybe use the entire library this snippet came from.<\/p>\n<p>So to find a middle ground, GitHub today launched a private beta of a code referencing feature for GitHub Copilot that will give developers this choice. With code referencing turned on, Copilot won\u2019t automatically block any matching code it generates but instead shows it to developers in a sidebar and lets them decide what to do with it. Over time, this feature will also come to Copilot Chat.<\/p>\n<p>GitHub previewed this feature last November but it clearly took a while to release it.<\/p>\n<p>As GitHub CEO Thomas Dohmke told me, Microsoft, GitHub and most Copilot enterprise customers were using the original blocking feature, but he also noted that it\u2019s a bit of a blunt tool. \u201cIt gives you little control to decide for yourself whether you actually want to take that code and attribute it back to an open source license. It doesn\u2019t actually let you discover that there might be a library that you could use instead of synthesizing code,\u201d he told me. \u201cIt prevents you from exploring these libraries and submitting pull requests. You might be reproducing everything that already exists in some open source repo.\u201d<\/p>\n<div id=\"attachment_2578353\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-2578353\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-2578353\" src=\"https:\/\/www.ghanamma.com\/gp\/wp-content\/uploads\/2023\/08\/github_code_match.gif\" alt=\"\" width=\"800\" height=\"800\"\/><\/p>\n<p id=\"caption-attachment-2578353\" class=\"wp-caption-text\"><strong>Image Credits:<\/strong> GitHub<\/p>\n<\/div>\n<p>Dohmke pointed out that this often applies to common computer algorithms, like sorting, which tend to exist in many different places. Now, developers can either reject the code, use it directly \u2014 assuming the library makes that possible \u2014 or have Copilot rewrite the code so it doesn\u2019t match the original code anymore.<\/p>\n<p>As of now, it\u2019s not possible to only see results that match specific licenses, but the team is actively looking for feedback to see if that is a feature users are asking for.<\/p>\n<p>\u201cWe\u2019re letting people understand the match and then go on and explore or go and make the right decision,\u201d Dohmke said. \u201cI think it fills the gap that the original solution had.\u201d<\/p>\n<p>The code referencing feature also tends to fire more often when there isn\u2019t a lot of context for Copilot to work with. When Copilot can see a lot of context from the existing code you are working on, it\u2019s unlikely to produce a suggestion that matches public code. But when you\u2019re just getting started, it\u2019s significantly more likely to generate matching code.<\/p>\n<p>At the core of this is a very fast search engine (GitHub says it wants to keep latency down to 10-20ms) that can quickly find the matching code and its license. As of now, the matching code snippets are listed in the order the search engine finds them. In its original announcement from last year, GitHub said that developers should have the \u201cability to sort that inventory by repository license, commit date, etc.,\u201d so I expect it\u2019ll add this functionality later.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Copilot has changed how developers write their code. However, it can also create issues when it creates code similar to what\u2019s already available in another public repository. In 2022, GitHub launched a feature that allowed users to block suggestions of matching public code automatically. According to a GitHub spokesperson, this system would trigger less [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":89161,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-89160","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com<\/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:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com\" \/>\n<meta property=\"og:description\" content=\"GitHub Copilot has changed how developers write their code. However, it can also create issues when it creates code similar to what\u2019s already available in another public repository. In 2022, GitHub launched a feature that allowed users to block suggestions of matching public code automatically. According to a GitHub spokesperson, this system would trigger less [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/\" \/>\n<meta property=\"og:site_name\" content=\"Ghanamma.com\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-04T08:21:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1440\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ghana News\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ghana News\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/\",\"url\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/\",\"name\":\"GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.ghanamma.com\/2023\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg\",\"datePublished\":\"2023-08-04T08:21:24+00:00\",\"dateModified\":\"2023-08-04T08:21:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/6f91dab2e50bbbfe895c93e7e84e7f74\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage\",\"url\":\"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg\",\"contentUrl\":\"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg\",\"width\":2560,\"height\":1440},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ghanamma.com\/2023\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GitHub Copilot can now tell developers when its suggestions match code in a public repository\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/#website\",\"url\":\"https:\/\/www.ghanamma.com\/2023\/\",\"name\":\"Ghanamma.com\",\"description\":\"Ghana mma provides breaking news, top stories in Ghana, Africa, business, entertainment, politics and more.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ghanamma.com\/2023\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/6f91dab2e50bbbfe895c93e7e84e7f74\",\"name\":\"Ghana News\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/22cb97c2b08df229330efb2b8c2645feaae8d3ca3ee434035fbb668b5b82f570?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/22cb97c2b08df229330efb2b8c2645feaae8d3ca3ee434035fbb668b5b82f570?s=96&d=mm&r=g\",\"caption\":\"Ghana News\"},\"sameAs\":[\"https:\/\/www.ghanamma.com\/2023\"],\"url\":\"https:\/\/www.ghanamma.com\/2023\/author\/ghanamma\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com","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:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/","og_locale":"en_US","og_type":"article","og_title":"GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com","og_description":"GitHub Copilot has changed how developers write their code. However, it can also create issues when it creates code similar to what\u2019s already available in another public repository. In 2022, GitHub launched a feature that allowed users to block suggestions of matching public code automatically. According to a GitHub spokesperson, this system would trigger less [&hellip;]","og_url":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/","og_site_name":"Ghanamma.com","article_published_time":"2023-08-04T08:21:24+00:00","og_image":[{"width":2560,"height":1440,"url":"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg","type":"image\/jpeg"}],"author":"Ghana News","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ghana News","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/","url":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/","name":"GitHub Copilot can now tell developers when its suggestions match code in a public repository - Ghanamma.com","isPartOf":{"@id":"https:\/\/www.ghanamma.com\/2023\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage"},"image":{"@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage"},"thumbnailUrl":"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg","datePublished":"2023-08-04T08:21:24+00:00","dateModified":"2023-08-04T08:21:24+00:00","author":{"@id":"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/6f91dab2e50bbbfe895c93e7e84e7f74"},"breadcrumb":{"@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#primaryimage","url":"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg","contentUrl":"https:\/\/www.ghanamma.com\/2023\/wp-content\/uploads\/2023\/08\/Match-found-zoomed-out-cropped-scaled-1.jpg","width":2560,"height":1440},{"@type":"BreadcrumbList","@id":"https:\/\/www.ghanamma.com\/2023\/08\/04\/github-copilot-can-now-tell-developers-when-its-suggestions-match-code-in-a-public-repository\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ghanamma.com\/2023\/"},{"@type":"ListItem","position":2,"name":"GitHub Copilot can now tell developers when its suggestions match code in a public repository"}]},{"@type":"WebSite","@id":"https:\/\/www.ghanamma.com\/2023\/#website","url":"https:\/\/www.ghanamma.com\/2023\/","name":"Ghanamma.com","description":"Ghana mma provides breaking news, top stories in Ghana, Africa, business, entertainment, politics and more.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ghanamma.com\/2023\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/6f91dab2e50bbbfe895c93e7e84e7f74","name":"Ghana News","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ghanamma.com\/2023\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/22cb97c2b08df229330efb2b8c2645feaae8d3ca3ee434035fbb668b5b82f570?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/22cb97c2b08df229330efb2b8c2645feaae8d3ca3ee434035fbb668b5b82f570?s=96&d=mm&r=g","caption":"Ghana News"},"sameAs":["https:\/\/www.ghanamma.com\/2023"],"url":"https:\/\/www.ghanamma.com\/2023\/author\/ghanamma\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/posts\/89160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/comments?post=89160"}],"version-history":[{"count":0,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/posts\/89160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/media\/89161"}],"wp:attachment":[{"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/media?parent=89160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/categories?post=89160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ghanamma.com\/2023\/wp-json\/wp\/v2\/tags?post=89160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}