Table of Contents
GitHub Commands
The following are all commands performed at a Linux terminal
To create a new folder on Github:
git add foldername
Note: A folder must already exist in the location where the repository has been cloned
To create a file under a folder:
touch filename
Note: It is important to git add the new file within the folder too otherwise a git commit will not work.
To commit changes made:
git commit -m “new folder”
Note: A comment always needs to be added when a commit is performed
To push changes to the repository:
git push
You will be prompted for your github Username and Password. The password is not password used to logon to your github account it is a PERSONAL ACCESS TOKEN that needs to be setup.
To remove a folder:
git rm foldername -r
Creating a Personal Access Token
1. Within your GitHub account go to settings from the top right menu
2. Select “Developer Settings” from the Settings menu
3. Expand “Personal Access Tokens” and click “Tokens (Classic)”
4. Click “Generate new token” and from the drop down select “Generate new token (classic)”
5. Give the token an appropriate name under “Note”. Select an appropriate Expiration time. Select all scopes that apply to the token you want to create. For example all scopes can be selected allowing all operations
Once scopes have been added. Click “Generate token”.
6. Copy the token code and keep in a safe place as it cannot be seen again once you leave the screen
This token replaces the password that is used for authentication with Github commands







