toshiki-notebook/assets/getting-started.md.919911ae.js

12 lines
10 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as s,c as a,o,R as n}from"./chunks/framework.a1bac067.js";const A=JSON.parse('{"title":"Git push results in \\"Authentication Failed”","description":"","frontmatter":{"title":"Git push results in \\"Authentication Failed”","author":"Anda Toshiki","date":"2023/2/21/ 10:54","editLink":true,"lastUpdated":true},"headers":[],"relativePath":"getting-started.md","filePath":"getting-started.md","lastUpdated":1684850019000}'),l={name:"getting-started.md"},e=n(`<h1 id="git-push-results-in-authentication-failed" tabindex="-1">Git push results in &quot;Authentication Failed” <a class="header-anchor" href="#git-push-results-in-authentication-failed" aria-label="Permalink to &quot;Git push results in &quot;Authentication Failed”&quot;"></a></h1><h2 id="issue" tabindex="-1">Issue <a class="header-anchor" href="#issue" aria-label="Permalink to &quot;Issue&quot;"></a></h2><div class="language-bash vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight vp-code-dark"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">git</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">push</span></span>
<span class="line"><span style="color:#FFCB6B;">Username</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">for</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">https://github.com</span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">{ GITHUB_USERNAME </span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">}</span></span>
<span class="line"><span style="color:#FFCB6B;">Password</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">for</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">https://andatoshiki@github.com</span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">{ GITHUB_PASSWORD </span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">}</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># or GitHub personal access token</span></span>
<span class="line"><span style="color:#FFCB6B;">remote:</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">Invalid</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">username</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">or</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">password.</span></span>
<span class="line"><span style="color:#FFCB6B;">fatal:</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">Authentication</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">failed</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">for</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">https://github.com/andatoshiki/andatoshiki.git/</span><span style="color:#89DDFF;">&#39;</span></span></code></pre><pre class="shiki one-dark-pro vp-code-light"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">git</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">push</span></span>
<span class="line"><span style="color:#61AFEF;">Username</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">for</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">&#39;https://github.com&#39;:</span><span style="color:#ABB2BF;"> \${{ </span><span style="color:#E06C75;">GITHUB_USERNAME</span><span style="color:#ABB2BF;"> }</span><span style="color:#98C379;">}</span></span>
<span class="line"><span style="color:#61AFEF;">Password</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">for</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">&#39;https://andatoshiki@github.com&#39;:</span><span style="color:#ABB2BF;"> \${{ </span><span style="color:#E06C75;">GITHUB_PASSWORD</span><span style="color:#ABB2BF;"> }</span><span style="color:#98C379;">}</span><span style="color:#ABB2BF;"> </span><span style="color:#7F848E;font-style:italic;"># or GitHub personal access token</span></span>
<span class="line"><span style="color:#61AFEF;">remote:</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">Invalid</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">username</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">or</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">password.</span></span>
<span class="line"><span style="color:#61AFEF;">fatal:</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">Authentication</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">failed</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">for</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">&#39;https://github.com/andatoshiki/andatoshiki.git/&#39;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p><code>git push</code> to GitHub remote branch failed via https protocol</p><h2 id="solution" tabindex="-1">Solution <a class="header-anchor" href="#solution" aria-label="Permalink to &quot;Solution&quot;"></a></h2><h3 id="solution-1" tabindex="-1">Solution 1 <a class="header-anchor" href="#solution-1" aria-label="Permalink to &quot;Solution 1&quot;"></a></h3><blockquote><p>If you enabled two-factor authentication in your GitHub account you won&#39;t be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your GitHub account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.</p></blockquote><p>You may also need to update the origin for your repository if it is set to HTTPS. Do this to switch to SSH:</p><div class="language-bash vp-adaptive-theme line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight vp-code-dark"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">git</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">remote</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">git</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">remote</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">set-url</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">origin</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">git@github.com:</span><span style="color:#A6ACCD;">$USERNAME</span><span style="color:#C3E88D;">/</span><span style="color:#A6ACCD;">$REPONAME</span><span style="color:#C3E88D;">.git</span></span></code></pre><pre class="shiki one-dark-pro vp-code-light"><code><span class="line"><span style="color:#61AFEF;">$</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">git</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">remote</span><span style="color:#ABB2BF;"> </span><span style="color:#D19A66;">-v</span></span>
<span class="line"><span style="color:#61AFEF;">$</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">git</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">remote</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">set-url</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">origin</span><span style="color:#ABB2BF;"> </span><span style="color:#98C379;">git@github.com:</span><span style="color:#E06C75;">$USERNAME</span><span style="color:#98C379;">/</span><span style="color:#E06C75;">$REPONAME</span><span style="color:#98C379;">.git</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h3 id="solution-2" tabindex="-1">Solution 2 <a class="header-anchor" href="#solution-2" aria-label="Permalink to &quot;Solution 2&quot;"></a></h3><p>GitHub username &amp; password/access token mismatched due to prior temporary Git config setup → Reset Git global username &amp; email config or in current repository</p><p><strong>To set your global username/email configuration:</strong></p><ol><li>Open the command line.</li><li>Set your username: <code>git config --global user.name &quot;FIRST_NAME LAST_NAME&quot;</code></li><li>Set your email address: <code>git config --global user.email &quot;MY_NAME@example.com&quot;</code></li></ol><p><strong>To set repository-specific username/email configuration:</strong></p><ol><li>From the command line, change into the repository directory.</li><li>Set your username: <code>git config user.name &quot;FIRST_NAME LAST_NAME&quot;</code></li><li>Set your email address: <code>git config user.email &quot;MY_NAME@example.com&quot;</code></li><li>Verify your configuration by displaying your configuration file: <code>cat .git/config</code></li></ol>`,15),t=[e];function p(r,c,i,y,u,C){return o(),a("div",null,t)}const h=s(l,[["render",p]]);export{A as __pageData,h as default};