I followed the instructions on the page that was set up on using Gitpod With The Curriculum and tried to connect to the get repo that I set up on the Github website. However I’m getting a public key error. How do I correct this?
Do I need to generate a key?
The authenticity of host 'github.com (20.29.134.23)' can't be established.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.```
I followed the tutorial set out in How To Use GitPod with This Curriculum. I went to my github and created a new public repo. I changed the permissions in the GitPod settings to allow public repos. Ran the commands to establish the remote origin url and checked it with a git remote -v. Created the main branch and tried to run a push and thats when I got that error
I will CC @moT01 on this, in case he has come across something similar.
Otherwise, my best suggestion is something like:
rm -rf .git
git init
git remote set-url origin https://github.com/<github-username>/<repository-name>.git
git branch -M main
git push -u origin main
Actually, writing that brings to mind that the git branch -M main step is probably not recommended for any of the Relational Database curriculum, because it is already initialised as a Git repo with main as the master branch.
You could manually configure Git to have the permissions to write to your account, but you would then need to do this for every workspace. You would do this by following GitHub’s docs: About authentication to GitHub - GitHub Docs
Is there another option beyond the manual way? I mean I’d like to continue on with the course I’m on (Bash Scripting) and I’d also like to back things up to my Git Repo.
So, it sounds like you just want to push the files you created from the course to your own repo.
I had the same error when I tried to do what you did. Something with CodeRoad or Gitpod not letting it push to GitHub maybe, I’m not sure. Anyway, there’s a lot of files for the course in the /project folder that you really don’t need in your repo. Here’s what I did that worked. Note that you should do this after you complete the entire course or the files won’t be in the right place to work on the course.
Create a new directory
Move all the files you want in your repo into the folder
Change to the new directory and git init to make a new repo git checkout -b main to create/switch to main branch git remote add origin your-repo.git git add . to add the files to staging git commit -m "message" git push origin main
So I wiped out the pod and just restarted the thing from scratch. I only did the git remote add URL part and when I went to push I only pushed the .sh file I created and that seemed to work out fine.
So related but separate question. My commit messages don’t show on github but instead it shows a Save Progress. Any ideas on how to change it show it shows the actual commit messages?
If you link the repo, I could take a look to try and give some more info. CodeRoad loads and makes commits, that’s how it progresses through the course. Adding/changing branches and making commits on your own could interfere with the course. The Save Progress commit is created by CodeRoad after each step you finish.
Different question and I’ll start a new thread if needed… I opened up a pinned gitpod workspace to finish up the Create 5 programs for learning bash… and the Class based material reverted to the beginning of the whole course. How do I get it back to where I left off without having to go through doing all the things again. Additionally, I told it to do a reset which removed the files I had done from the /project folder. They are on my repo, but I can’t seem to get it to pull them back down because it says the branches diverged… not sure I want to rebase… but I DO NOT want to start all over.