History of Coding - github Authentication
<p>A quick sanity check from a useful <a href="https://thomasthornton.cloud/2025/06/30/solving-the-github-403-error-why-your-push-may-be-blocked-and-how-i-fixed-it/">blog by Thomas Thornton</a></p>
<pre>
git remote -v</pre>
<p>This should return the correct github address for the directory one has currently navigated to.</p>
<pre>
h auth refresh</pre>
<p>First problem was that the gh function was not loaded, and then after loading it I got another couple of errors which I failed to make a note of, but now this process runs cleanly</p>
<pre>
! First copy your one-time code: nnnn-nnnn
Press Enter to open https://github.com/login/device in your browser...
✓ Authentication complete.</pre>
<p>Previously I had jumped through another few steps including ...</p>
<pre>
git config --global user.name &quot;lsces&quot;
git config --global user.email &quot;lester@lsces.co.uk&quot;
git remote set-url origin https://github.com/lsces/bitweaver.git
git config --global --add safe.directory /srv/website/bitweaver
</pre>
<p>In addition, I needed to create a suitable SSH key which used the following script</p>
<pre>
ssh-keygen -t ed25519 -C &quot;lester@lsces.co.uk&quot;
eval &quot;$(ssh-agent -s)&quot;
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
git fetch origin
ssh -T git@github.com
</pre>
<p>And finally I am not sure where this fits into the jigsaw but I think it post dates the set-url above.</p>
<pre>
git remote set-url origin &quot;https://lsces:github_pat_@github.com/lsces/bitweaver.git
</pre>
<p>At some point I will tidy this, but now I have it working it's difficult to check just what is necessary, Any input welcome and at some point I will switch the comment facility back on to open a the discussion ... that is providing it does not get overwhelmed with crap again.</p>
<pre>
git remote -v</pre>
<p>This should return the correct github address for the directory one has currently navigated to.</p>
<pre>
h auth refresh</pre>
<p>First problem was that the gh function was not loaded, and then after loading it I got another couple of errors which I failed to make a note of, but now this process runs cleanly</p>
<pre>
! First copy your one-time code: nnnn-nnnn
Press Enter to open https://github.com/login/device in your browser...
✓ Authentication complete.</pre>
<p>Previously I had jumped through another few steps including ...</p>
<pre>
git config --global user.name &quot;lsces&quot;
git config --global user.email &quot;lester@lsces.co.uk&quot;
git remote set-url origin https://github.com/lsces/bitweaver.git
git config --global --add safe.directory /srv/website/bitweaver
</pre>
<p>In addition, I needed to create a suitable SSH key which used the following script</p>
<pre>
ssh-keygen -t ed25519 -C &quot;lester@lsces.co.uk&quot;
eval &quot;$(ssh-agent -s)&quot;
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
git fetch origin
ssh -T git@github.com
</pre>
<p>And finally I am not sure where this fits into the jigsaw but I think it post dates the set-url above.</p>
<pre>
git remote set-url origin &quot;https://lsces:github_pat_@github.com/lsces/bitweaver.git
</pre>
<p>At some point I will tidy this, but now I have it working it's difficult to check just what is necessary, Any input welcome and at some point I will switch the comment facility back on to open a the discussion ... that is providing it does not get overwhelmed with crap again.</p>
