1

I've been trying to go through this tutorial: https://www.youtube.com/watch?v=ghL-KlAhBnc

But when I tried to push, after following everything, I got the following problem: cant push refs to remote. try running pull first...

I went to the menu in Source Control and tried the Pull option. I then got an error saying 'Git: There is no tracking information for the current branch'

Next, I found this solution to the issue: There is no tracking information for the current branch

The problem is, since I am working with a tutorial in VS code, I don't think I can do that, because I get the 'fatal: not a git repository (or any of the parent directories): .git

How would I go about solving my original issue in VS code..?

To clarify, I am completely new with github. I used it with VS 2017 but when it worked it worked, I didn't have to worry about much. I have got git bash but not sure how to use it.

Papbad
  • 163
  • 2
  • 13

2 Answers2

0

At 12.05 mark in the video, pay attention to the initialization of a new GitHub repository: it must be empty.

If you create a GitHub repo with a README file, for instance, then it would have a commit of its own, hence your error message when doing your first push.

In your case, a simple git push --force would be enough.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

I've found the best way to get files into VS code is to git clone the repo that you're trying to edit into a local folder. Form there, open visual studio with "open folder" and edit form there. If you get the same error, pull straight from VS code, and try pushing again.