Why does git clone not copy remote branch and give error message when git status? problem with upstream?

182 Views Asked by At

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?

1

There are 1 best solutions below

0
ramwin On

Use following commands to upload your commit:

git push origin main