{"id":404,"date":"2018-06-28T01:21:10","date_gmt":"2018-06-28T01:21:10","guid":{"rendered":"https:\/\/kevingoedecke.com\/?p=404"},"modified":"2018-06-28T01:26:27","modified_gmt":"2018-06-28T01:26:27","slug":"setup-sourcetree-with-homebrew-gpg-invalid-gpg-path","status":"publish","type":"post","link":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/","title":{"rendered":"Setup Git + SourceTree with HomeBrew GPG on MacOS &#8211; Invalid GPG Path"},"content":{"rendered":"<p>I recently added my GPG key to my git in order to sign commits. While doing so I ran into big problem. SourceTree wouldn&#8217;t allow me to configure it to use my <a href=\"http:\/\/brewformulas.org\/Gnupg\">HomeBrew GPG<\/a> installation (Error message: Invalid GPG Path). By default SourceTree only works with the <a href=\"https:\/\/gpgtools.org\/\">GPG Suite<\/a> under MacOS, which is quite annoying since HomeBrew is pretty much my go-to approach to install anything command line related, as it should be for everyone \ud83d\ude09<\/p>\n<p>In order to get SourceTree working with GPG (GNUPG) under Mac you need to do the following.<\/p>\n<p>1. First install all GPG HomeBrew packages and\u00a0<a href=\"https:\/\/github.com\/GPGTools\/pinentry-mac\"><span class=\"s1\">Pinentry for Mac<\/span><\/a><\/p>\n<pre class=\"lang:sh decode:true\">$ brew install gpg-agent gpg2 libgpg-error pinentry-mac<\/pre>\n<p>2. If you haven&#8217;t already generated your GPG key:<\/p>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"lang:default decode:true highlight\">$ gpg --gen-key<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\u00a0You&#8217;ll be asked a couple of questions in order to generate your key, afterwards you should see an output similar to this:<\/div>\n<div>\n<pre class=\"lang:default decode:true\">$ gpg --gen-key \r\n\r\n...\r\n\r\npub   rsa2048 2018-06-28 [SC] [expires: 2020-06-22]\r\n      0A46826A\r\nuid                      Kevin Goedecke &lt;kevin.goedecke@gmail.com&gt;\r\nsub   rsa2048 2018-06-22 [E] [expires: 2020-06-22]\r\n<\/pre>\n<p>Now tell you git cli to sign your commits with the key, that you just generated (replace the key ID with the key from the previous step).<\/p>\n<pre class=\"lang:default decode:true \">$ git config --global user.signingkey 0A46826A<\/pre>\n<p>After you&#8217;ve done this open SourceTree and then the settings (CMD + ,) and click on the &#8220;Advanced&#8221; tab on the right.<\/p>\n<figure id=\"attachment_405\" aria-describedby=\"caption-attachment-405\" style=\"width: 600px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-405\" src=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew-300x246.png\" alt=\"\" width=\"600\" height=\"492\" srcset=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew-300x246.png 300w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew-768x630.png 768w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew-1024x840.png 1024w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gpg-homebrew.png 1578w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-405\" class=\"wp-caption-text\">SourceTree GPG HomeBrew Settings<\/figcaption><\/figure>\n<p>Click on Browse and navigate to\u00a0<span class=\"lang:default decode:true crayon-inline \">\/usr\/local\/bin<\/span>\u00a0, homebrew created already a symlink to\u00a0<span class=\"lang:default decode:true crayon-inline \">..\/Cellar\/gnupg\/2.2.8\/bin\/gpg<\/span>\u00a0here. Usually we would like to point SourceTree to this path and that&#8217;s it. But wait if we select this directory and try to close the settings. We get this:<\/p>\n<p><a href=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-410\" src=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error-300x174.png\" alt=\"\" width=\"450\" height=\"261\" srcset=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error-300x174.png 300w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error-768x445.png 768w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error-1024x593.png 1024w, https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/invalid-gpg-path-error.png 1064w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Annoying&#8230; but there&#8217;s a little workaround. We will create a symlink to make SourceTree think there a file called\u00a0<span class=\"lang:default decode:true crayon-inline \">gpg2<\/span>\u00a0. So let&#8217;s just do that:<\/p>\n<pre class=\"lang:default decode:true \">$ ln -s ..\/Cellar\/gnupg\/2.2.8\/bin\/gpg \/usr\/local\/bin\/gpg2\r\n<\/pre>\n<p>Afterwards you can simply select the directory in SourceTree and it will accept it as your GPG binary.<\/p>\n<\/div>\n<p>Cheers<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently added my GPG key to my git in order to sign commits. While doing so I ran into big problem. SourceTree wouldn&#8217;t allow me to configure it to use my HomeBrew GPG installation (Error message: Invalid GPG Path). By default SourceTree only works with the GPG Suite under MacOS, which is quite annoying [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":413,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-404","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke<\/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:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke\" \/>\n<meta property=\"og:description\" content=\"I recently added my GPG key to my git in order to sign commits. While doing so I ran into big problem. SourceTree wouldn&#8217;t allow me to configure it to use my HomeBrew GPG installation (Error message: Invalid GPG Path). By default SourceTree only works with the GPG Suite under MacOS, which is quite annoying [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/\" \/>\n<meta property=\"og:site_name\" content=\"Kevin Goedecke\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-28T01:21:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-28T01:26:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kevin Goedecke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kevin Goedecke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/\",\"name\":\"Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke\",\"isPartOf\":{\"@id\":\"https:\/\/kevingoedecke.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg\",\"datePublished\":\"2018-06-28T01:21:10+00:00\",\"dateModified\":\"2018-06-28T01:26:27+00:00\",\"author\":{\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\"},\"breadcrumb\":{\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg\",\"contentUrl\":\"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg\",\"width\":1800,\"height\":900},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kevingoedecke.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setup Git + SourceTree with HomeBrew GPG on MacOS &#8211; Invalid GPG Path\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kevingoedecke.com\/#website\",\"url\":\"https:\/\/kevingoedecke.com\/\",\"name\":\"Kevin Goedecke\",\"description\":\"Founder. Entrepreneur.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kevingoedecke.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871\",\"name\":\"Kevin Goedecke\",\"url\":\"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke","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:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/","og_locale":"en_US","og_type":"article","og_title":"Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke","og_description":"I recently added my GPG key to my git in order to sign commits. While doing so I ran into big problem. SourceTree wouldn&#8217;t allow me to configure it to use my HomeBrew GPG installation (Error message: Invalid GPG Path). By default SourceTree only works with the GPG Suite under MacOS, which is quite annoying [&hellip;]","og_url":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/","og_site_name":"Kevin Goedecke","article_published_time":"2018-06-28T01:21:10+00:00","article_modified_time":"2018-06-28T01:26:27+00:00","og_image":[{"width":1800,"height":900,"url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg","type":"image\/jpeg"}],"author":"Kevin Goedecke","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kevin Goedecke","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/","url":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/","name":"Setup Git + SourceTree with HomeBrew GPG on MacOS - Invalid GPG Path - Kevin Goedecke","isPartOf":{"@id":"https:\/\/kevingoedecke.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage"},"image":{"@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage"},"thumbnailUrl":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg","datePublished":"2018-06-28T01:21:10+00:00","dateModified":"2018-06-28T01:26:27+00:00","author":{"@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871"},"breadcrumb":{"@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#primaryimage","url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg","contentUrl":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg","width":1800,"height":900},{"@type":"BreadcrumbList","@id":"https:\/\/kevingoedecke.com\/blog\/2018\/06\/28\/setup-sourcetree-with-homebrew-gpg-invalid-gpg-path\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kevingoedecke.com\/"},{"@type":"ListItem","position":2,"name":"Setup Git + SourceTree with HomeBrew GPG on MacOS &#8211; Invalid GPG Path"}]},{"@type":"WebSite","@id":"https:\/\/kevingoedecke.com\/#website","url":"https:\/\/kevingoedecke.com\/","name":"Kevin Goedecke","description":"Founder. Entrepreneur.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kevingoedecke.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kevingoedecke.com\/#\/schema\/person\/4b156cd6453e1af4bab9076b0a663871","name":"Kevin Goedecke","url":"https:\/\/kevingoedecke.com\/blog\/author\/kgoedecke\/"}]}},"jetpack_featured_media_url":"https:\/\/kevingoedecke.com\/blog\/wp-content\/uploads\/2018\/06\/sourcetree-gnupg.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/comments?post=404"}],"version-history":[{"count":5,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":411,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions\/411"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/media\/413"}],"wp:attachment":[{"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kevingoedecke.com\/blog\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}