Here I explain how I did it on Windows.
Make sure to install Git and GitHub.
After installation is complete, open Git Bash.

So a window like below is going to pop up:

Go ahead and type cd ~
to make sure you are in the home directory. You can check the address that you are in it by typing pwd
;
Now you need to create a GitHub account. After creating a GitHub account, go ahead and sign in.
After you signed in, on the top right click on the + and choose “New Repository”

Then in the opened window, type the name that you wish to have for the repository in the “Repository name” box. Add “Description (optional)” if you like, and mark “Initialize this repository with a README”. Then click on “Create repository”.

Now go to your C drive; create a new folder and name it “git”. Now go to the “Git Bash” window; change the directory to c drive by typing cd ~; cd /c
.
If you type ls
there it would show you the folders there. Make sure it shows the Git folder there:

Now go back to the browser; go to your GitHub page, click on the repository that you made, click on “Clone or download”, and copy the address that shows there (by choosing copy to clipboard).

Now going back to “Git Bash”. Use the command cd git
to go to the git folder; now write the following commands to connect to your GitHub (enter the username and password of your GitHub when it asks you):
git config --global user.name "Your Name"
And then: git config --global user.email youremail@domain.com
.
Next type: git clone (URL)
, instead of the (URL), type the address of the GitHub repository that you copied from your GitHub page; (e.g., git clone https://github.com/isalirezag/Test.git
).
Now if you do ls
command you will see your repository there. If you also open the Git folder that you have in your window you will see that your repository is added as a folder.
Now use the cd command to go to the repository: cd Test
Go ahead and copy and paste any files that you want to put in this repository in that folder.
In order to transfer the files to your repository you need to do following now:
Type git
add filename
(filename is the file name that you want to upload) or you can type the command below if you want to add all the files in the folder:
git add .
Then type: git commit -m "adding files"
. And then: git push -u origin master
.
And then you should be all set. If you refresh your GitHub account, the files should be there :)