pull down to refresh

Currently taking the JavaScript lesson and I am trying to create my own repo and I am running into a bug
When I run git push I get the following message
fatal: The current branch main has no upstream branch. To push the current branch and set the remote as upstream, use
git push —set upstream origin main
When run that command VS code hangs then under a search bar I see Git: https//github.com (Press Enter to confirm or escape to cancel)
When I hit “enter” twice my terminal gives me this error
remote: No anonymous write access. Fatal: authentication failed for “https://my repo location”
I been stuck here for a some time now. I’m on stack overflow and none of their suggestions are working (turn off git terminal Authentication, and the use of personal access tokens)
Any idea what I should do @bitcoinplebdev
This is a super common Git authentication issue! I have to do some googling everytime I go through this process myself, it's kind of annoying...
  1. First, ensure you've configured Git with your GitHub email and username:
git config --global user.name "Your GitHub Username"
git config --global user.email "your@github.email"
  1. Create a personal access token (PAT) on GitHub:
Go to GitHub.com → Settings → Developer settings → Personal access tokens → Tokens (classic) Generate new token Select repo scope Copy the generated token
  1. When pushing, use HTTPS with your token:
git remote set-url origin https://YOUR_GITHUB_USERNAME:YOUR_PAT@github.com/YOUR_USERNAME/YOUR_REPO.git
Finally you can try:
git push -u origin main
If you're still having issues, verify:
  • Your GitHub account has write access to the repository
  • You're using the correct repository URL
reply
Thanks I’ll give this a try. Yeah it is super annoying. I had to stop the course because I couldn’t get my git work. I’ll definitely try this
reply
LMK if this doesn't work! Happy to jump on a call to pair program
reply
Yeah I gave it a shot for about 1 hour and nothing worked. Now I am getting an error that the repository can’t be found after adding my token. I am all the way confused. The first day I pushed to GitHub no problem following your html example but now with the JavaScript nothing is working. Authentication just keeps failing and I can’t push! Very perplexing.
I even tried to start from scratch with a new repo following your slides and still no success
reply
Sorry about the trouble... Wanna jump on call today? I think we can figure this out in a few mins probably
reply
Today wont work for me. Maybe tomorrow or any day over the weekend.
Hey it’s not your fault. I’m just glad you are responding and helping.
Learning to code has been extremely lonely journey for me .
It’s nice to have someone to chat with and talk out the issues. It keeps me motivated and engaged and not pushing this off.
Because when you are learning alone when you hit an issue you say to yourself oh I’ll get to that tomorrow. Then tomorrow become next week and before you know it you quit.
547 sats \ 0 replies \ @ek 12 Feb
Isn't the repository path missing in here?
git remote set-url origin https://YOUR_GITHUB_USERNAME:YOUR_PAT
You only set the username and authentication token, but no path to a repository, so the 404 error @BlokchainB is getting would make sense
edit: oof, our markdown is swallowing some text after @, click here to see the raw text with full instructions