Why can't i push my files on github. It shows that i don't have the correct access rights or the repo doesn't exist. How can i resolve this? - github

I am trying to set up my local computer to be able to send files up on github but for some reason i am facing several issues while doing so.
So this is what it shows on cmd.
And this is what it shows on github page.
As you can notice it shows i made the last change a week so obviously my commits weren't pushed to the main branch.
Please help me figure out what the problem is here.
The name of my repo on github is MyWebsite and the local folder is mywebsite. Perhaps that is causing the issue? I also have generated a ssh key if that's a matter of concern.
Thanks.

I will go through step by step what you need to do:
1.Checking for existing SSH keys
Before you generate an SSH key, you should check if you already have an existing SSH key. You can easily check for existing SSH keys by using the Git bash and entering the following command that lists the files in the .ssh directory which has been located most often on following path C:\Users\Jakobson\.ssh. For this example I used my path from my local.
Command for checking the files where ssh keys have been stored after generating is:
ls -al ~/.ssh
By default, the filenames of the public keys are one of the following:
id_rsa.pub id_ecdsa.pub id_ed25519.pub .
If .ssh directory haven't any existing files, you should generate new ssh key which is described in next step.
2.Set up an SSH key
You can generate an SSH key by running the ssh-keygen procedure on your computer. You will need to remember where you have saved the generated public and private RSA key pair. The steps for generating a new SSH key are:
Open the Git bash.
Enter the following command by entering your GitHub email address:
ssh-keygen -t ed25519 -C "youremailaddress"
Note: If you are using a legacy system that doesn’t support the Ed25519 algorithm, use:
ssh-keygen -t rsa -b 4096 -C "youremailaddress"
This creates a new SSH key using the provided email as a label.
Next thing git bash will ask you to enter the file destination where ssh keys will be generated like this:
> Enter a file in which to save the key (/c/Users/Jakobson/.ssh/id_ed25519):[Press enter]
If you press enter, it will be saved automatically in .ssh directory, or you can specify other destination path.
Then you will be asked to enter a passphrase. You can leave it empty.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
After this, ssh keys will be generated in your .ssh directory.
3.Adding Your SSH Key to the ssh-agent
You can start the ssh-agent in the background by typing in your git-bash:
eval `ssh-agent -s
And then you can add the private key file that you have generated by typing:
ssh-add ~/.ssh/id_rsa
4.Adding the SSH Key to Your GitHub
You need to copy SSH public key to your GitHub.
Copy all content from C:\Users\Your machine name\.ssh\id_rsa.pub file
Go to https://github.com/settings/keys -> SSH and GPG keys and click on new ssh key. Name ssh key optionally, and paste content from your file. That is all.
If you want to add ssh key to specific repository on remote server, go to your repository settings, then go to deploy keys and add ssh key on the same way we did before. You can see that at this screenshot https://i.imgur.com/lPDrFN5.png
Note: If you need to type your password when you try to push on server again, type your fingerprint which has been generated after adding ssh key on your profile/settings/keys and value is something like: SHA256:rLiDkFpEz9FT3/9cNVu9NlL8BIxCS you will find that in your ssh keys of your profile.

You can create a new token at: https://github.com/settings/tokens
Generate a new token (classic); and
then try to git clone a repo.
After inserting the login name you will be asked to enter the password. Use the generated token as the password.

Related

SSH Key - How can I add a new key to github?

I'm attempting to add pbcopy < ~/.ssh/id_rsa.pub in GitHub but this is the error message I'm getting: Key is invalid. You must supply a key in OpenSSH public key format.
Any suggestions on how I can add this? I've googles several different commands.
Thanks in advance!
libsecp256k1-static/stable 20200902-1 arm
Static libraries for libsecp256k1
Try to go to the file destination (~/.ssh/id_rsa.pub) and copy past it into GitHub. Follow steps 1, 2 & 3 to get to where you want to paste it. After Copy pasting use command (in Git Bash) ssh -t git#github.com to authenticate.
For Windows users, there are two things to consider
your console should parse quotation and double quotation in the right order.
curl needs quotation for JSON properties and keys.
So how can we debug it:
Add "-v --trace-ascii -" to the curl command to see log for command.
Use echo or write-host for your data in cmd or PowerShell
It is so important to make sure that curl receives valid JSON data.
See an example for Windows PowerShell here

Store data in a file and get reference path to it

I wish to create an environment file not "variable" and get a path to it in the TravisCI pipeline.
Attached is the image of how we do the same in gitlab
gitlab environment file image
I need to store secrets in a file refer is via a path in travisci pipeline.
Ex: this is how we can do the same in Jenkins:
"KUBECONFIG=/var/lib/jenkins/.kube/filename"
I am not will to upload my secrets file to github private repo.
The encrypt-file command will encrypt an entire file using symmetric (AES-256) encryption and stores the secret in a file. Let us create a file called secret.txt and add the following entries into it: SECRET_VALUE=ABCDE12345 CLIENT_ID=rocky123 CLIENT_SECRET=abc222222!
travis encrypt-file secret.txt -> give this command after creating secret.txt file and it will store result as secret.txt.enc and also shows ->add the following to your build script (before_install stage in your .travis.yml , for instance): - openssl aes-256-cbc -K $encrypted_74945c17fbe2_key -iv $encrypted_74945c17fbe2_iv -in secret.txt.enc -out secret.txt -d
Now add this entry into our .travis.yml script: ( before_install: - openssl aes-256-cbc -K $encrypted_74945c17fbe2_key -iv $encrypted_74945c17fbe2_iv -in secret.txt.enc -out secret.txt -d ) , It can then decrypt values in the secret text file for us
So it is to create a file and use command travis encrypt-file secret.txt, it will then produces an entry, copy that entry and add it into our .travis.yml file in before_install stage
make sure to add the secret.txt.enc to the git repository and make sure NOT to add the secret.txt to the git repository
Generally, we cannot keep both the encryption key and encrypted file in the same place(i.e repo). So, we store the file somewhere else. Where are you storing it? How will you fetch it?

Sparkle-project setup

I'm trying to implement Sparkle into my macOS project using cocoapod.
But when following the documentation I seem to have a problem creating the public .pem file.
Command used in Terminal;
.ssh $ ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/Users/jorgen/.ssh/id_dsa): dsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in dsa.
Your public key has been saved in dsa.pub.
According to the documentation I should have a file called dsa_pub.pem but all I end up with is dsa.pub
If anyone has a couple of minutes to give me simple step-by-step instructions how to set this up, I would be immensely appreciative.
I was going to use a DropBox folder as the https:// address. I archive the app into a .app as far as I can understand, I would zip this and put it in the DB folder? What else goes in there?
Download sparkle: https://sparkle-project.org
go to the bin folder inside the archive
open that folder in Terminal (drag and drop from folder)
call ./generate_keys to generate dsa_priv.pem and dsa_prb.pem in the same folder

Polymer 2.0 upload to GitHub-Pages

I have problem with uploading my Polymer component into gh pages.
I'm try this from tutorial:
# git clone the Polymer tools repository somewhere outside of your
# element project
git clone git://github.com/Polymer/tools.git
# Create a temporary directory for publishing your element and cd into it
mkdir temp && cd temp
# Run the gp.sh script. This will allow you to push a demo-friendly
# version of your page and its dependencies to a GitHub pages branch
# of your repository (gh-pages). Below, we pass in a GitHub username
# and the repo name for our element
../tools/bin/gp.sh <username> <test-element>
# Finally, clean-up your temporary directory as you no longer require it
cd ..
rm -rf temp
But it's not working.
In terminal I have this errors:
There is something I'm, missing?
Here is your problem:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
For the script to run as intended, you need to add your public ssh key to your github project. Settings -> Deploy keys -> Add deploy Key.
Alternatively, you can manually execute the steps in gp.sh that involve pulling from and pushing to github.
If you don't feel like splitting up the script, try running the commands manually, that should work. The only multi-line command in the script is this one:
echo "{
\"directory\": \"components\"
}
" > .bowerrc
Good luck.

Github: New SSH key

I have very little knowledge about SSH etc. I was trying to add new SSH key on Github. For this I followed this procedure:
On Terminal
work#Nirvair:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/work/.ssh/id_rsa):
Created directory '/home/work/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/work/.ssh/id_rsa.
Your public key has been saved in /home/work/.ssh/id_rsa.pub.
Then there was key fingerprint and key's randomart image.
On Browser
I opened:
Github >> Settings >> SSH and GPG keys >> New SSH key
It asked for Title and Key. I gave some title and then I copied my key id_rsa.pub there. It gave an error:
Key is invalid. It must begin with 'ssh-ed25519', 'ssh-rsa', 'ssh-dss', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', or 'ecdsa-sha2-nistp521'. Check that you're copying the public half of the key
I have no idea how to proceed further. Please tell me where I am wrong or direct me to a good tutorial.
OS details: Ubuntu 14.04.5
Thanks!
PS: I tried to read about "key fingerprint" and "key's randomart image" over the internet but everything went over my head
Are you sure you perfectly copied your public key?
Execute
cat /home/work/.ssh/id_rsa.pub
and copy everything to your clipboard.
You can also try with xclip:
xclip -sel clip < /home/work/.ssh/id_rsa.pub