Creating a Repository

Generating a Token

Generating an ssh Key

#!/bin/bash

# replace $1 with your github username
username=$1

# replace $2 with your github email
email=$2

# reset git config
git config --system --unset credential.helper

# set git config 
git config --global user.name $username
git config --global user.email $email

# generate ssh-key used for authentication
ssh-keygen -t rsa -m PEM -C $email

# copy ssh-key to clipboard
clip < ~/.ssh/ida_rsa.pub
pcbopy < ~/.ssh/ida_rsa.pub


echo navigate to https://github.com/settings/keys and paste the contents of your clipboard

Create a Remote Repository

  1. Navigate to github.com/new
  2. click “new” button at the top right of browser

Creating a Local Repository and Pushing to Remote Repository

  1. Navigate to the root folder of the project you would like to become a repository.
  2. git init
    • this generates a .git folder in this directory.
    • the .git tells this directory that it is a git-repository, enabling subsequent git commands in this directory.
  3. git add .
    • adds all changes in this directory to the repository
    • this modifies the contents of the aforementioned .git folder
  4. git commit -m 'my update message'
    • commits these changes to be pushed onto the web
    • this modifies the contents of the aforementioned .git folder
  5. git push -u origin master
    • pushes the committed changes onto the web, making them accessible through the web.
    • the local .git is compared to the remote .git, and respective changes are written as a new commit

Cloning a Preexisting Project

Adding Changes to Preexisting Git Repository

  1. navigate to the root directory of the project on your local machine
  2. add changes
    • git add .
  3. commit change
    • git commit -m 'update message'
  4. push changes to web
    • git push -u origin master
  5. Refresh the webpage to ensure your changes are visible.

Pulling Changes from Remote Repository to Local Repository