1. Go to your git hub account and create a new empty repository

When creating the repository, make sure that you don't create the README, otherwise the repository starts with an initial commit, which may conflict with your local git commit history.


  1. Get your remote Link(Either http or ssh)


  1. Go to your local repository, and the remote link to the repository
git remote add origin <link>
  1. Fetch the origin
git fetch origin
  1. Push the changes to your remote repository, since in you don’t have upstream branch already setup, we need set it in the command.
git push --set-upstream origin main
  1. Observe your remote repository, and observe whether the commit history matches your local git log