- Add git repository in local project
// Navigate to the root of your project
git init
git remote add origin <remote-url>
- Check all remote repositories
git remote -v
- Change the local name of your branch to match the name "main" in remote repository (GitHub default branch name)
git branch -M main
- Push the local commits in your repository to your remote, and to start tracking your local branch against the remote branch
git push -u origin main
git push --set-upstream origin main