1

I'm want to connect my github account to vs code and have tried various things. I made sure the email I added in my terminal was the same one in my account settings. I've tried adding an ssh key (which I might've done wrong since I'd never done that before). I added the Gitlens extension, logged into my account, then deactivated and reactivated git in vs code.

I created a repository in vs code and made two commits. Everything shows up in vs (except that my commits don't show up in the timeline). I tried opening a repository I created on github in vs code and that didn't work either.

How do I get the two to communicate together? Thanks.

redfox
  • 21
  • 3

1 Answers1

2

Creating commits on VSCode has no bearing on a remote GitHub repository.

You would need to push them ("Sync") in order for them to be published.

What you should do is:

  • make sure your SSH key is recognized: ssh -Tv git@github.com
  • make sure you have created an empty repository on GitHub
  • go to your local repository folder
  • type git remote add origin git@github.com:Me/MyNewProject
    (Replace "Me" with your GitHub user account name, and MyNewProject with a more meaningful name)
  • go back to VSCode, and click on the "Sync" button

You should see your commits on GitHub.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @redfox Great, well done! With IDEs using Git, it is generally helpful to fall back temporarily to the command-line whenever there is an issue. Once it is working from command-line, chances are it works better in the IDE. – VonC Aug 03 '22 at 07:39