{"id":17269,"date":"2021-11-15T19:59:33","date_gmt":"2021-11-15T18:59:33","guid":{"rendered":"https:\/\/ekiwi-blog.de\/?p=17269"},"modified":"2021-11-15T19:59:33","modified_gmt":"2021-11-15T18:59:33","slug":"sourcetree-and-github-please-use-a-personal-access-token-instead","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/17269\/sourcetree-and-github-please-use-a-personal-access-token-instead\/","title":{"rendered":"SourceTree and GitHub: please use a personal access token instead"},"content":{"rendered":"<p>On a new computer, I was not able to clone and access my GitHub projects with SourceTree. Instead, there was always the error message that I need to use a personal access token.<\/p>\n<p><!--more--><\/p>\n<p>I searched the internet and found a lot of other people struggling with the same error message. Interesting enough, the basic authentication was still working on my other computer. <\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/17269\/sourcetree-and-github-please-use-a-personal-access-token-instead\/#The_problem\" >The problem<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/17269\/sourcetree-and-github-please-use-a-personal-access-token-instead\/#What_I_tried_and_did_not_work\" >What I tried and did not work<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ekiwi-blog.de\/en\/17269\/sourcetree-and-github-please-use-a-personal-access-token-instead\/#The_solution\" >The solution<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"The_problem\"><\/span>The problem<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The issue started when I wanted to clone a repo. SourceTree would just tell me that the URL is not valid.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_1.png\" alt=\"\" width=\"480\" height=\"175\" class=\"aligncenter size-full wp-image-17270\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_1.png 480w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_1-300x109.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<pre>\r\nThis is not valid source path \/ URL\r\n<\/pre>\n<p>Looking in the details, the usage of a personal access token is the way to go now.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_2.png\" alt=\"\" width=\"451\" height=\"309\" class=\"aligncenter size-full wp-image-17272\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_2.png 451w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_2-300x206.png 300w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/p>\n<pre>\r\nError: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.\r\nremote: Please see https:\/\/github.blog\/2020-12-15-token-authentication-requirements-for-git-operations\/ for more information.\r\nfatal: Authentication failed for\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"What_I_tried_and_did_not_work\"><\/span>What I tried and did not work<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I tried a lot of stuff I found on the internet. I generated a personal access token. It is often stated to use the token as password, however, this did not work. I also tried to set up the account as OAuth, this seemed to work but resulted in the same error message. <\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_solution\"><\/span>The solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>After I have been pissed off enough, I decided to use SSH. In order to do that, you have to create a SSH key pair. SourceTree installs &#8220;puttygen.exe&#8221;. You can find it in the installation folder.<\/p>\n<pre>\r\nC:\\Users\\da\\AppData\\Local\\SourceTree\\app-3.4.6\\tools\\putty\r\n<\/pre>\n<p>I generated a key, saved the private key to a file and copied the public key to the clipboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_3.png\" alt=\"\" width=\"737\" height=\"639\" class=\"aligncenter size-full wp-image-17274\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_3.png 737w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_3-300x260.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>Now the public key needs to be added to GitHub. This can be done in the settings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_4.png\" alt=\"\" width=\"794\" height=\"333\" class=\"aligncenter size-full wp-image-17276\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_4.png 794w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_4-300x126.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_4-768x322.png 768w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/p>\n<p>Enter a name and paste the key.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_5.png\" alt=\"\" width=\"758\" height=\"443\" class=\"aligncenter size-full wp-image-17278\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_5.png 758w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_5-300x175.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/p>\n<p>Now the private key needs to be set in the SSH Client Configuration section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_6.png\" alt=\"\" width=\"687\" height=\"141\" class=\"aligncenter size-full wp-image-17280\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_6.png 687w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_6-300x62.png 300w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/p>\n<p>After that I was able to clone the repos using the SSH link.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_7.png\" alt=\"\" width=\"652\" height=\"382\" class=\"aligncenter size-full wp-image-17282\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_7.png 652w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/source_7-300x176.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>On a new computer, I was not able to clone and access my GitHub projects with SourceTree. Instead, there was<\/p>\n","protected":false},"author":1,"featured_media":17284,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1565,1559],"class_list":["post-17269","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-software-en","tag-tutorial-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/17269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=17269"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/17269\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/17284"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=17269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=17269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=17269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}