Several commands that we will use :
echo "# GitHub" >> README.md
git init
git add README.md
git commit -m "First commit"
git branch -M main
git remote add origin <GitHub repository URL>
git push -u origin main
First of all, choose the directory you want to work with Git. If you still didn't made one, then make one first. Check "How To Navigate Through Directories and Create New Directory Using Terminal.md" on how to do it.
For example, I make a new directory called "GitHub-Tutorial" that will be used as git repository

Type echo "# GitHub" >> README.md. This command will create a README file which is important for a repository to give information and describe the repository itself.

Create a GitHub repository from GitHub.com, check how to do it in "How To Create Repository.pdf". Copy the given URL in the new repository.

In order to make GitHub-Tutorial directoy as a git repository, we need to initialize it first with command git init. This command will create a git init file in the directory.

Type git add README.md to add the README file into the working tree. You can also use git add . which will add all directories and files in the working directory into the working tree.
Then, type git commit -m "First commit" to add description on your commit upon these files.

Tips: If you feel your terminal start to piled up with commands, try to type clear command to clear/erase all the previous entered commands. Don't worry, if you want to check what commands have you entered previosly, you can still check it with history command.
Type git branch -M main to create new branch with the name "main". And type git remote add origin <GitHub URL> to add the GitHub URL we have copied before as remote URL.

Type git push -u main to push the files in working tree to the GitHub repository branch main. The terminal will then ask your username and password, fill in the username but fill in the password with a token you have created before.

