GitHub is an especially useful tool to share code in a secure manner by providing a two-step process to uploading and downloading code from the internet. Instead of repositories automatically updating on a PC, someone has to first "pull" the new updates to the code. When uploading new code, a user first state the changes made before pushing to the main repo.
First, go to GitHub.com and create an account.
Once you have created an account, click the green "New" button on the top-left corner as show in the image on the right.
Once the "Create a new repository" page appears, enter a repository name. Here you can include a description and choose whether to make it public or private. Here I chose Public. Also make sure to checkmark the box for "Add a README file" off to prevent issues since the repo will be blank otherwise.
Next, navigate to a local folder in which you would like to save the repo and its contents over time. Here I chose my Documents folder and created a GitHub folder within it. Open a terminal window and cd into this folder as well.
Type in "git clone REPO_URL" and hit enter
Replace REPO_URL with the URL of your newly created GitHub repository.
To commit a file, try using a test file. Here I cd into the repo and created a test.txt file using VIM and adding a sentence in the file as well. Afterwards, I type "git add .", then "git commit", and the I type in a commit message "Uploading test document". Finally I type "git push" to push the changes.
Here we can see the uploaded file as well as the commit message. Opening the .txt will then show us the contents.