-1

I just created my own github page which is finalexam96.github.io

On Visual Studio Code, I did git clone https://github.com/finalexam96/finalexam96.github.io.git

I created an index.html file committed everything and it worked. But when I try to check it out with git status, it says

On branch main Your branch is based on 'origin/main', but the upstream is gone. (use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean

I tried to see if I have proper branches and typed git branch which is for local branch and it shows

*main

Then I tried git branch -r, but it showed nothing. so I believe the remote branch doesn't exist.

At this point, I didn't know what to do, so I used git remote add origin https://github.com/finalexam96/finalexam96.github.io.git but it returns

error: remote origin already exists

So my remote branch exists but it won't show up when I try to see a list of remote branch.

I want to see #of commits ahead when I use git status

What should I do to make this work?

  • "I want to see #of commits ahead when I use git status" Well you're not going to. Your remote repository at Github is *empty.* There is nothing to be ahead of. You have to give it initial content with your first push. That is why simple `git push` is not yet allowed. – matt May 30 '23 at 11:05

1 Answers1

0

Use following commands to upload your commit:

git push origin main
ramwin
  • 5,803
  • 3
  • 27
  • 29