Sign up for a GitHub account on github.com if you don't already have one.
Create a new empty repository on GitHub. Do not initialize it with a README or other files.
On your local machine, add the GitHub remote repository as a remote:
git remote add origin https://github.com/your_username/your_repo.git
Replace the URL with your GitHub repository URL.
Push your local repository to the remote repository on GitHub:
git push -u origin master
Go to your repository page on GitHub to see if your files and commits have been pushed successfully.
To sync future commits, simply run
git push
which will push to the same remote repo.Now your local and remote repositories are connected. You can push local commits to GitHub to store them remotely and enable collaboration.
ย