This tutorial walks you through how to make a git repository and upload it to github. You will walk through:
- Initialization
- Staging
- Commiting changes
- Pushing your local repoistory to Github
Keep in mind that all the commands are run in the terminal
First, you will need to create a directory which is going to be your local repository.
You can do that by running the command mkdir followed by the directory name.
Change your current working directory to the directory you have just made using the command cd [directory-name]
To initialize the current directory as the local repository for git to work on, run the command git init
The next step after making changes to the local repository is to stage it to get it ready for the next commit.
You can do so by running the command git add . in the root directory of your local repository.
Make sure to always check the status to make sure changes are now tracked using the command git status
Now you can commit the changes permanently providing a useful message for others using the command git commit -m "[mesage]"
The final step is to push the local repository to the remote repository (github) using the command git push -u origin main
Assuming you did not make any other branches. If so, replace "main" by the branch name you want to push to Github.