This morning I just went through the steps of creating a Github account and repository. Here are the steps.

Github Account

  1. Navigate to Github
  2. Click on the Sign up button
  3. Fill in fields
  4. Verify email to begin using account

Two-factor Authentication

Follow instructions to set up two-factor authentication:

  1. In upper-right corner click profile picture and then settings
  2. In settings sidebar, select security
  3. Setup any or all of the Two-factor methods

Personal Access Token

In order to access the account from the command line after the two-factor authentication is set up a personal access token must be created:

  1. In upper-right corner click profile picture and then settings
  2. In settings sidebar, select Developer settings
  3. At next menu, select Personal access token
  4. Click button Generate new token
  5. Provide token description
  6. Select all options including word “repo
  7. Click button Generate token
  8. Save token to secure vault for later use

Create Repository

Now a repository can be created:

  1. In upper right corner, click + drop down menu, and select New Repository
  2. Provide name and description
  3. Choose between public or private
  4. If necessary, setup README, .gitignore, and license

At the Ubuntu BASH Terminal

In the following BASH code, the “git pull” and “git push” commands will prompt for the Github username and password. At the password prompt enter the personal access token that was generated above. Using the regular Github password will not work when two-factor authentication is enabled.

$ sudo apt update 
$ sudo apt git 
$ cd /path/to/software/directory
$ git init
$ git remote add origin https://github/<git username>/<name of repository>
$ git remote -v
$ git add --all
$ git commit -m "Initial Commit"
$ git pull origin master --allow-unrelated-histories
$ git push origin master

On the Github Website

Now that the software has been uploaded to the repository, navigate to the github website and do a cursory check to ensure all files were uploaded.

Categories: gitSoftware