Following a recent change to GitHub, username and passwords would no longer work with Netbeans and others when interacting with repositories. Other IDE's such as Jetbrains are able to use Tokens but Netbeans proved to be a little more stubborn.
SEE NOTE BELOW
So, we firstly need to check if we have a private/public key, see here.
ls -al
On my mac I have the private and public keys respectively:
id_rsa
id_rsa.pub
If needed, generate a public key by;
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
see here
from inside the .ssh directory, do the following to copy your key to the clipboard;
pbcopy < id_rsa.pub
see here to add it to GitHub.
You can test the connection by;
ssh -T git@github.com
see here
Additionally some notes regarding a passphrase can be found here.
Finally, the GitHub connection window in Netbeans should look like the below;
To update any existing remotes from URL's to SSH, do;
Change to the directory of the project.
git remote -v
This will list the URL's and we can then do;
git remote set-url origin git@github.com:plisken1/repository_name.git
We can then verify by running git remote -v again and we should see the changes.
NOTE
While the above ssh key seems to work fine with Mac OS, I could not get it to work under Linux, see here.
This does however seem to work with a Personal Access Token as per the screen shot below;
here we used the https format for the repository URL and paste our token string into the password field.
The token string will be in a format similar to:
ghp_G8sh7FVdje7Q0PJnie3...
No comments:
Post a Comment
Note: only a member of this blog may post a comment.