<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Albir Tarsha</title>
    <description>The latest articles on DEV Community by Albir Tarsha (@mtsafe).</description>
    <link>https://dev.to/mtsafe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F482313%2F50973d25-ce9f-4924-9260-0eddf8af3c45.jpeg</url>
      <title>DEV Community: Albir Tarsha</title>
      <link>https://dev.to/mtsafe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mtsafe"/>
    <language>en</language>
    <item>
      <title>“[GitHub] Deprecation Notice” for Password to Git Resolved</title>
      <dc:creator>Albir Tarsha</dc:creator>
      <pubDate>Thu, 22 Apr 2021 04:37:10 +0000</pubDate>
      <link>https://dev.to/mtsafe/github-deprecation-notice-for-password-to-git-resolved-2gja</link>
      <guid>https://dev.to/mtsafe/github-deprecation-notice-for-password-to-git-resolved-2gja</guid>
      <description>&lt;p&gt;One Small Step For GitHub Security Requires One Giant Leap For Casual Git Users&lt;/p&gt;

&lt;h1&gt;
  
  
  “using a password to Git is deprecated”
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Distant Early Warning
&lt;/h3&gt;

&lt;p&gt;By now you have probably received an email similar to this and disregarded it as August 13, 2021 was quite far away. Now being April I felt that I had sufficiently procrastinated and it was time for a spring cleaning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi @my_username,&lt;/p&gt;

&lt;p&gt;You recently used a password to access the repository at MyTeam/ProjectRepo with git using git/2.25.1.&lt;/p&gt;

&lt;p&gt;Basic authentication using a password to Git is deprecated and will soon no longer work. Visit &lt;a href="https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/"&gt;https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/&lt;/a&gt; for more information around suggested workarounds and removal dates.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br&gt;
The GitHub Team&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thus began my quest to fix this warning before being locked out in August….&lt;/p&gt;

&lt;p&gt;To keep this short I will not talk about the travails chronologizing how I uncovered this fix. Instead I will simply elaborate upon the order that I used the referenced documents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Is My Password Information Being Kept?
&lt;/h3&gt;

&lt;p&gt;I set up git and my GitHub years ago and forgot how I did it. Googling “git config” gave me the command &lt;code&gt;git config --list&lt;/code&gt; which helped me establish that I did use macOS Keychain.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git config --list
credential.helper=osxkeychain
[etc ...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next I removed the github entry as described here in this document. &lt;br&gt;
&lt;a href="https://docs.github.com/en/github/getting-started-with-github/updating-credentials-from-the-macos-keychain#deleting-your-credentials-via-the-command-line"&gt;https://docs.github.com/en/github/getting-started-with-github/updating-credentials-from-the-macos-keychain#deleting-your-credentials-via-the-command-line&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git credential-osxkeychain erase
host=github.com
protocol=https
[Press Return again leaving a blank line]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command &lt;code&gt;git push&lt;/code&gt; will now ask for Username and Password demonstrating that the password is cleared out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great, Now How Do I Git Back In?
&lt;/h3&gt;

&lt;p&gt;I used a tip from airtower-luna:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The smallest change from using your password  would be to create a personal access token (PAT) with the &lt;em&gt;repo scope&lt;/em&gt; and use that instead of your password when pushing. Using a password manager to keep the token is a good idea.”&lt;br&gt;
[Reference: &lt;a href="https://github.community/t/account-access-password-deprivation-keys-clueless/152106/2"&gt;https://github.community/t/account-access-password-deprivation-keys-clueless/152106/2&lt;/a&gt;]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And I followed the instructions contained below to create a personal access token, checking the box for the scope “repo” at step 7. Immediately I saved a copy of the token. (Copy-paste.) I tested my token using &lt;code&gt;git push&lt;/code&gt; and passed the token for the password.&lt;br&gt;
&lt;a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token"&gt;https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How Do I Stash That Token?
&lt;/h3&gt;

&lt;p&gt;Lol. The token is already saved. The token was stored for future use automatically when I tested &lt;code&gt;git push&lt;/code&gt; and passed the token. So executing &lt;code&gt;git push&lt;/code&gt; again gave no password request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git push
Username for 'https://github.com': my_username
Password for 'https://my_username@github.com': 
Everything up-to-date
$ git push
Everything up-to-date
$ 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  More About The Requirements
&lt;/h2&gt;

&lt;p&gt;For more about the requirements from GitHub you can refer to the GitHub Blog. &lt;a href="https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/"&gt;https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, back to work.&lt;/p&gt;

</description>
      <category>github</category>
      <category>authentication</category>
      <category>git</category>
      <category>deprecated</category>
    </item>
  </channel>
</rss>
