What you asked in the question is the most fundamental aspect of Git and Github. Let me take the exact steps for what you requested.
1) To create a new Git repository, go to the project folder using the terminal (or another equivalent program for your OS) / Open the terminal in the folder and enter the following command
git init
This initializes your project with an empty Git repository.
Now you can make changes to your project and write these changes to separate commits. Here how you do the commit
git commit -m "YOUR COMMIT MESSAGE"
To redirect your repo to github / any other Git hosting service, you first need to add the remote repository URL as follows
$ git remote add origin you@yourserver _url.git
Now it is ready to click. Run the following command to do this
$ git push origin master
2) You need a server to interact with Git
Eli answered this very well, but simply summed up. No no. Most people use an existing service like Github, Bitbucket, Gitlab, etc. To host your repositories, in which case you just need to interact with the remote repo using the remote URL.
3) How to push / pull from a remote repo?
First you need access to the repo if it is private (if you are not good to go). Then enter the repo url, it should look something like this.
https://github.com/YOUR_USERNAME/YOUR_PROJECT.git (This URL example is from github)
Next, you need to clone it to the local machine as follows
git clone https:
Now that you have cloned it, make the necessary changes and just click on it using the command below.
There's more to version control than just the basics. If you want to know more, there is an interactive site try.imtqy.com , which you can find to learn the basics or read this article that I have written on the same one, it should help you get started.
Here is the link https://www.techlila.com/version-control-git/